mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +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={
|
||||
REGEXP_ONLY_DIGITS_AND_CHARS
|
||||
}
|
||||
onChange={(e) => {
|
||||
field.onChange(e);
|
||||
if (e.target.value.length === 6) {
|
||||
mfaForm.handleSubmit(onSubmit)();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<InputOTPGroup>
|
||||
<InputOTPSlot
|
||||
|
||||
Reference in New Issue
Block a user