mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-01 19:17:00 +08:00
fix: handle firebase rate limit when requesting email verification
!nuf
This commit is contained in:
parent
c8a04fa8e4
commit
bd7f06be9a
1 changed files with 9 additions and 1 deletions
|
@ -200,12 +200,20 @@ export async function sendVerificationEmail(
|
|||
);
|
||||
} else if (e.errorInfo.code === "auth/too-many-requests") {
|
||||
throw new MonkeyError(429, "Too many requests. Please try again later");
|
||||
} else if (
|
||||
e.errorInfo.code === "auth/internal-error" &&
|
||||
e.errorInfo.message.toLowerCase().includes("too_many_attempts")
|
||||
) {
|
||||
throw new MonkeyError(
|
||||
429,
|
||||
"Too many Firebase requests. Please try again later"
|
||||
);
|
||||
} else {
|
||||
throw new MonkeyError(
|
||||
500,
|
||||
"Firebase failed to generate an email verification link: " +
|
||||
e.errorInfo.message,
|
||||
true + " " + JSON.stringify(e)
|
||||
JSON.stringify(e)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue