Merged in fix/SW-1695-clear-otp-password-on-error (pull request #1375)
Clear and focus OTP input on error Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -100,6 +100,7 @@ export default function OneTimePasswordForm({
|
||||
function handleOTPEntered(otp: string) {
|
||||
startTransition(async () => {
|
||||
const redirectRes = await onSubmit({ otp })
|
||||
setOtp("")
|
||||
if (redirectRes.type === "replace") {
|
||||
router.replace(redirectRes.url)
|
||||
return
|
||||
@@ -146,6 +147,7 @@ export default function OneTimePasswordForm({
|
||||
</div>
|
||||
|
||||
<OTPInput
|
||||
autoFocus
|
||||
value={otp}
|
||||
onChange={setOtp}
|
||||
maxLength={otpLength}
|
||||
|
||||
Reference in New Issue
Block a user