fix(web): surface check-code email login errors to the user#38336
Open
SquabbyZ wants to merge 1 commit into
Open
fix(web): surface check-code email login errors to the user#38336SquabbyZ wants to merge 1 commit into
SquabbyZ wants to merge 1 commit into
Conversation
The /signin/check-code page handles two async calls:
* verify() — submits the 6-digit code via emailLoginWithCode(...).
* resendCode() — requests a new code via sendEMailLoginCode(...).
Both wrap the call in try/catch but on failure only call
console.error(error) and return. No toast appears, the page just
silently stays in its prior state, and the user has no idea why
their click did nothing.
This change adds toast.error(t('error.unknown', { ns: 'login' }))
in both catch blocks so the user sees feedback when the network call
or backend rejects. A new error.unknown key is added to
web/i18n/en-US/login.json; other locales will be resynced by the
i18n:check workflow.
diff --stat:
web/app/signin/check-code/page.tsx | 10 ++++++++--
web/i18n/en-US/login.json | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
Generated via peaks-loop (session 2026-07-02-session-95565c, request
2026-07-02-fix-check-code-silent-errors). Red-line scope was limited
to check-code/page.tsx and one new i18n key.
4 tasks
Member
|
Thanks for the contribution. Before we review this PR, please open an issue first to describe the problem, expected behavior, and proposed approach, then link that issue here. This helps us confirm the scope and align on the fix before moving forward. |
6 tasks
Contributor
Author
|
@crazywoola Thanks for the guidance. Opened issue #38411 describing the |
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.
Fixes #38411
Summary
The
/signin/check-codepage handles two async calls:verify()??submits the 6-digit code viaemailLoginWithCode(...).resendCode()??requests a new code viasendEMailLoginCode(...).Both wrap the call in
try/catchbut on failure only callconsole.error(error)and return. No toast appears, the page just silently stays in its prior state, and the user has no idea why their click did nothing.This change adds
toast.error(t('error.unknown', { ns: 'login' }))in both catch blocks so the user sees feedback when the network call or backend rejects.Changes
web/app/signin/check-code/page.tsx: addtoast.error(...)afterconsole.error(error)in bothverify()andresendCode()catch blocks.web/i18n/en-US/login.json: adderror.unknownkey.Diff stat
Test plan
/signin/check-code??click Verify ??confirm an error toast appears.pnpm i18n:checkclean (other locales flagged as missing the new key, expected ??backfill via i18n sync workflow).pnpm lintandpnpm type-checkclean on the touched file.Risk / behavior preservation
console.error(error)is preserved so log monitoring still picks up the failure.verify()finallyblock still resetssetIsLoading(false)in all paths.ret.result === 'success') is unchanged.Related
peaks-loopsession2026-07-02-session-95565cduring a project scan on 2026-07-02.Automation
Generated via peaks-loop (full-auto mode). Red-line scope was limited to
web/app/signin/check-code/page.tsxand one new i18n key inweb/i18n/en-US/login.json. Commit message includes the peaks-loop provenance line for traceability.?? Generated with Claude Code via peaks-loop