fix(auth): recover from SSO provider lookup errors - #6966
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 823b2f2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR makes SSO initiation failures recoverable and non-disclosing by handling both resolved Better Auth errors and rejected requests, restoring the enabled submit state after completion.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or non-blocking defects identified in the changed behavior. The form now handles both resolved Better Auth errors and rejected requests without exposing backend details, and the focused tests verify that users can retry after either failure mode.
|
| Filename | Overview |
|---|---|
| apps/sim/ee/sso/components/sso-form.tsx | Handles resolved and rejected SSO initiation failures uniformly, prevents raw backend error disclosure, and restores the retryable form state. |
| apps/sim/ee/sso/components/sso-form.test.tsx | Adds focused interaction coverage for resolved and rejected failures, generic error presentation, button recovery, and retry. |
Reviews (1): Last reviewed commit: "fix(auth): recover from SSO provider loo..." | Re-trigger Greptile
Summary
Fix the global SSO form so Better Auth HTTP failures returned through
result.errorrestore an idle, retryable state instead of leaving the submit button stuck on “Redirecting to SSO provider…”. All initiation failures now use the same generic client message, while the existing non-disclosing backend 404 and successful redirect flow remain unchanged.Related: Slack thread and security discussion
Type of Change
Testing
NEXT_PUBLIC_APP_URL=http://localhost:3000 bunx vitest run ee/sso/components/sso-form.test.tsx— 7 tests passedbunx biome check apps/sim/ee/sso/components/sso-form.tsx apps/sim/ee/sso/components/sso-form.test.tsx— passed with no fixes requiredbun run --cwd apps/sim type-check— passedReviewers should focus on the resolved-error path, generic non-disclosing copy, and restoration of the enabled submit state for retry. Focused tests also cover rejected requests and verify raw provider/domain errors are never rendered.
Checklist
Screenshots/Videos
Not applicable: this changes error-state behavior and copy without changing layout; the regression is covered by focused interaction tests. The original stuck-state screenshot is available in the linked Slack thread.