feat(web): move auth off server actions (by Lumen)#249
Open
conoremclaughlin wants to merge 3 commits intomainfrom
Open
feat(web): move auth off server actions (by Lumen)#249conoremclaughlin wants to merge 3 commits intomainfrom
conoremclaughlin wants to merge 3 commits intomainfrom
Conversation
Route password, OTP, signup, OAuth, and logout through Next route handlers instead of client-invoked server actions. This removes plaintext password arguments from Next dev server-action logs, keeps auth as an explicit HTTP boundary for future provider additions, and preserves MCP callback plus PCP refresh-token revocation behavior.
Handle non-2xx auth route responses as structured error payloads and restore mocked fetch cleanup in the logout route test to prevent spy leakage between Vitest files.
Catch retryable Supabase auth fetch/socket failures in the shared server-auth helpers and return a user-facing explanation instead of leaking or other opaque auth errors when the local Supabase stack is unhealthy.
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.
Summary
Why
Next dev was logging server action arguments, including plaintext password values for
signInWithPassword(...). Moving auth to route handlers removes that exception from the stack and makes auth easier to automate and extend for future providers.Validation
cd packages/web && npx vitest run src/lib/auth/server-auth.test.ts src/app/api/auth/logout/route.test.tscd packages/web && python3 - <<'PY' import shutil shutil.rmtree('.next', ignore_errors=True) PY yarn type-checkPOST /api/auth/loginnow logs only the route/timing, not the submitted password argsNotes