Gracefully handle error when user login code is expired

This commit is contained in:
sabaimran
2024-12-16 16:47:54 -08:00
parent 064f7e48ca
commit efb0b9f495
3 changed files with 12 additions and 5 deletions

View File

@@ -261,6 +261,8 @@ function EmailSignInContext({
} else if (res.status === 429) {
setOTPError("Too many failed attempts. Please try again tomorrow.");
setNumFailures(ALLOWED_OTP_ATTEMPTS);
} else if (res.status === 403) {
setOTPError("OTP expired. Please request a new one.");
} else {
throw new Error("Failed to verify OTP");
}