Repository navigation
Explain and avoid the verification email resend limit - #2385
Merged
Mephistic merged 1 commit intoNov 21, 2026
Merged
Conversation
Firebase sends one verification email a minute to an account. Asking again sooner fails with auth/too-many-requests, which had no message of its own, so readers saw "Something went wrong!". - Give auth/too-many-requests a message, with wording specific to the resend button that tells the reader an email was just sent. - Record each verification email sent, including the one at sign-up, and hide the resend button on both verify sections until the minute is up, so a reload doesn't bring it straight back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D33UhQgSR1T7cdPD4z3TYD
mvictor55
requested review from
Mephistic,
alexjball,
kiminkim724,
mertbagt,
nesanders,
sashamaryl and
timblais
as code owners
November 20, 2026 22:58
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Mephistic
approved these changes
Nov 21, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After sign-up, MAPLE sends a verification email. If a reader clicks "Send Another Link" within about a minute of the last email, Firebase rejects the request (
400 TOO_MANY_ATTEMPTS_TRY_LATERfromaccounts:sendOobCode, which the SDK throws asauth/too-many-requests). That code had no entry inerrorMessages, so the reader saw "Something went wrong!". Reproduced on production on Nov 20 with a new email/password account: blocked 21 seconds after a send, accepted again 73 seconds after it.No issue filed; found while debugging a user report.
This PR:
auth/too-many-requeststoerrorMessages("Too many attempts. Please wait a few minutes and try again."), and lets a single hook override the shared wording for a code. The resend hook says "A verification email was sent to you very recently. Check your inbox and spam folder, or try again in a minute." The shared wording stays general because sign-in throws the same code after repeated wrong passwords.localStoragekeyed by user ID (with an in-page fallback when storage is unavailable). Both verify sections (the liveVerifyAccountSectionLegacyand the flaggedVerifyAccountSection) hide the resend button for that minute and show the existing "Check your email!" message instead. A reload no longer brings the button straight back. After the minute the button returns; before, it stayed hidden after a send until the page was reloaded.Checklist
errorMessagesmap incomponents/auth/hooks.ts. No other new text.VerifyAccountSectionstory is unaffected.)firestore.indexes.json(None.)Checks run:
yarn check-types,yarn test:website(45 suites pass, including the newcomponents/auth/verificationEmailCooldown.test.ts),eslinton the changed files,yarn check-formatting.yarn test(Cloud Functions) not run; no backend changes.Screenshots
None. The visible changes are the button staying hidden, with the existing "Check your email!" message, for a minute after a send, and the new error text.
Known issues
UNAUTHORIZED_DOMAIN, as happened on production from the Nov 13 release untilwww.mapletestimony.orgwas added to authorized domains on Nov 20),sendVerificationretries immediately without one. If the rejected request counts toward the same per-minute limit, the retry fails withauth/too-many-requestsand no email goes out. That may be why the fallback didn't rescue those sign-ups. If confirmed, a follow-up should passurl: location.hrefonly on authorized origins rather than rely on the retry. A preview deploy is a good place to check, since its domain isn't authorized (see step 6).Extra Deploy Steps
None.
Steps to test/reproduce
🤖 Generated with Claude Code
https://claude.ai/code/session_01D33UhQgSR1T7cdPD4z3TYD