mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 17:26:38 +00: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:
@@ -215,6 +215,12 @@ export default function LoginForm({ redirect, onLogin }: LoginFormProps) {
|
|||||||
pattern={
|
pattern={
|
||||||
REGEXP_ONLY_DIGITS_AND_CHARS
|
REGEXP_ONLY_DIGITS_AND_CHARS
|
||||||
}
|
}
|
||||||
|
onChange={(e) => {
|
||||||
|
field.onChange(e);
|
||||||
|
if (e.target.value.length === 6) {
|
||||||
|
mfaForm.handleSubmit(onSubmit)();
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<InputOTPGroup>
|
<InputOTPGroup>
|
||||||
<InputOTPSlot
|
<InputOTPSlot
|
||||||
|
|||||||
Reference in New Issue
Block a user