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:
Alex Freidel 2025-04-28 08:14:19 +02:00
parent 4084849fdc
commit a5b782b72a

View file

@ -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