fix(auth): make SSO failures recoverable on the login flow - #212
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(auth): make SSO failures recoverable on the login flow#212posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
Turn a backend SSO failure into a clear, recoverable state instead of a dead end. - Map known gateway and identity-provider errors to human copy on `/auth/error` through a shared `resolveAuthError` resolver (authorization_request_not_found, invalid_token_response, session expired, AADSTS family). Keep the raw string as a small diagnostic detail, not the headline. - Point the error page "Go to Login" button at `routes.auth.login` instead of the raw `/auth` path, which is the Sign Up tab. Also fixes a route-registry violation. - Give the login screen a channel to surface a failed callback: read `?error=` and show it in an Alert above the form. - Make the signup submit honest: keep "Create Account" enabled while the debounced availability check runs and explain the wait on click, instead of leaving a silently disabled button. Generated-By: PostHog Desktop Task-Id: 268adebd-c386-4714-bc13-bc3fa3f5646d
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.
Problem
/auth/error, cannot self-serve past it, and loop through the login screen./auth/erroris reached on every one of the last 60 days across dev, qa,openframe.miami, and productionopenframe.ai(low volume, ~1–10 sessions/day), and 30 days of$rageclickdata shows dead-control frustration on/auth/signup,/auth/login, invite pages, "Continue with Google", and "Create Account".[authorization_request_not_found], fullAADSTS700016…text)error/page.tsxrenderssearchParams.get('error')verbatim; the error-code map is never consulted/auth, not the login form/auth/loginshows nothinglogin-form-section.tsxhas no channel to read a callback failurecheckingstateThe root authentication failure is on the OpenFrame gateway, not in this repo. This change improves error clarity, return navigation, and button honesty; it does not fix the OAuth callback itself.
Changes
resolveAuthErrorinauth-error-codes.tsmaps the cases seen in the recordings —authorization_request_not_found,invalid_token_response, session expired, and theAADSTSfamily — to plain copy. Matching is substring-based, so a bracket-wrapped code or the full provider text both resolve. The raw string stays as a small diagnostic detail below the message.routes.auth.logininstead of the raw/authstring (also clears a route-registry violation).?error=and shows the resolved message in anAlertabove the form, so a silent bounce is no longer silent.Testing
npm run type-check— cleannpm run lint:biome(changed files) — cleannpm run build— compiles;/auth/errorand/auth/loginbuild as expectedCreated with PostHog Desktop from this inbox report.