Skip to content

fix(web): surface check-code email login errors to the user#38336

Open
SquabbyZ wants to merge 1 commit into
langgenius:mainfrom
SquabbyZ:fix/check-code-silent-errors
Open

fix(web): surface check-code email login errors to the user#38336
SquabbyZ wants to merge 1 commit into
langgenius:mainfrom
SquabbyZ:fix/check-code-silent-errors

Conversation

@SquabbyZ

@SquabbyZ SquabbyZ commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #38411

Summary

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.

Changes

  • web/app/signin/check-code/page.tsx: add toast.error(...) after console.error(error) in both verify() and resendCode() catch blocks.
  • web/i18n/en-US/login.json: add error.unknown key.

Diff stat

web/app/signin/check-code/page.tsx | 10 ++++++++--
web/i18n/en-US/login.json          |  2 ++
2 files changed, 10 insertions(+), 2 deletions(-)

Test plan

  • Manual: throttle network on /signin/check-code ??click Verify ??confirm an error toast appears.
  • Manual: throttle network ??click Resend ??confirm an error toast appears.
  • Happy path: enter correct code ??confirm existing redirect flow unchanged.
  • pnpm i18n:check clean (other locales flagged as missing the new key, expected ??backfill via i18n sync workflow).
  • pnpm lint and pnpm type-check clean on the touched file.

Risk / behavior preservation

  • Catch blocks only add a toast; the existing console.error(error) is preserved so log monitoring still picks up the failure.
  • verify() finally block still resets setIsLoading(false) in all paths.
  • Happy path (ret.result === 'success') is unchanged.
  • No backend, schema, or migration changes.

Related

Automation

Generated via peaks-loop (full-auto mode). Red-line scope was limited to web/app/signin/check-code/page.tsx and one new i18n key in web/i18n/en-US/login.json. Commit message includes the peaks-loop provenance line for traceability.

?? Generated with Claude Code via peaks-loop

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.
@SquabbyZ SquabbyZ requested review from douxc and iamjoel as code owners July 2, 2026 15:49
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 2, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 2, 2026

Copy link
Copy Markdown
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.

@SquabbyZ

SquabbyZ commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@crazywoola Thanks for the guidance. Opened issue #38411 describing the /signin/check-code silent error swallowing in verify() and resendCode(), the proposed toast.error(...) addition, and the new i18n key. PR description now links the issue via Fixes #38411. Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/signin/check-code silently swallows errors from verify() and resendCode()

2 participants