Skip to content

Surface sign-in failures instead of failing silently - #89

Merged
jasandroidx merged 1 commit into
ravenstackfrom
fix-silent-signin-error
Sep 23, 2026
Merged

jasandroidx merged 1 commit into
ravenstackfrom
fix-silent-signin-error

Conversation

@jasandroidx

Copy link
Copy Markdown
Owner

Summary

Found while testing the Mechanic v3 preview (#88): clicking "Continue with Google" on /login did nothing visible.

routes/login.tsx's button called signIn(p.providerId, ...) with no .catch(). signIn() (in lib/auth/client.ts) throws on failure — e.g. when authClient.signIn.oauth2() errors — and with no handler that becomes a silent unhandled promise rejection. From the user's side that's indistinguishable from a dead button.

Most likely real-world trigger: the app federates sign-in through a shared auth broker that only recognizes a fixed set of registered redirect origins. An ad-hoc preview URL (a Vercel branch preview, in this case) isn't on that list, so the broker rejects the callback and signIn() throws — silently, until now.

Change

routes/login.tsx: the click handler now catches the rejection and shows it via toast.error(...) (Sonner is already mounted at root in __root.tsx, so no new dependency). This does not fix the underlying broker-allowlist gap — sign-in on an arbitrary preview URL will still fail — it just makes the failure visible instead of silent, on every origin.

Verification

Run from ui-v2/:

  • npm run typecheck ✅
  • npm test ✅ (28 pass)
  • npm run build:box ✅
  • npm run lint ✅ (1 pre-existing, unrelated warning in drops.test.ts)

No services restarted, nothing merged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PESvczRwpL58x1u2fepPFM


Generated by Claude Code

signIn() throws on failure (broker rejects the callback origin, popup
blocked, etc.), and the login button's onClick never caught it -- an
unhandled promise rejection that reads as "the button does nothing" with
no feedback at all. Now shown as a toast. Most likely trigger: the auth
broker only recognizes a fixed set of redirect origins, so sign-in fails
this way on any ad-hoc preview URL (e.g. a Vercel branch preview) that
isn't on that allowlist -- this doesn't fix that allowlist gap, it just
makes the failure visible instead of silent.
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ravenstack-keep Ready Ready Preview Sep 23, 2026 1:38am UTC

Request Review

@jasandroidx
jasandroidx merged commit 237f23d into ravenstack Sep 23, 2026
4 checks passed
@jasandroidx
jasandroidx deleted the fix-silent-signin-error branch September 23, 2026 01:48

This branch was successfully deployed

1 active deployment
Preview — 4e334e42 Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants