mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-12 21:30:35 +01:00
feat: enhance 2fa login
As soon as all digits have been entered, the form will be sent automatically. Similar to GitHub's implementation.
This commit is contained in:
parent
4084849fdc
commit
a5b782b72a
1 changed files with 6 additions and 0 deletions
|
@ -215,6 +215,12 @@ export default function LoginForm({ redirect, onLogin }: LoginFormProps) {
|
|||
pattern={
|
||||
REGEXP_ONLY_DIGITS_AND_CHARS
|
||||
}
|
||||
onChange={(e) => {
|
||||
field.onChange(e);
|
||||
if (e.target.value.length === 6) {
|
||||
mfaForm.handleSubmit(onSubmit)();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<InputOTPGroup>
|
||||
<InputOTPSlot
|
||||
|
|
Loading…
Reference in a new issue