Skip to content

fix: auth callback redirect, onboarding enforcement, and session validation - #54

Merged
SaharPak merged 4 commits into
mainfrom
fix/auth
Jul 2, 2026
Merged

fix: auth callback redirect, onboarding enforcement, and session validation#54
SaharPak merged 4 commits into
mainfrom
fix/auth

Conversation

@SaharPak

Copy link
Copy Markdown
Owner

Summary

  • Fix production OAuth/magic-link callback so Cloudflare x-forwarded-host no longer overwrites the onboarding redirect for new users
  • Enforce profile setup in the proxy: signed-in users without a handle are redirected to /onboarding
  • Block open redirects in login and callback via safeRedirectPath
  • Replace getSession() with getUser() on server pages so auth is verified server-side

Test plan

  • Google sign-in on production redirects new users to /onboarding
  • Magic link sign-in completes and sets session cookies
  • Returning users with a handle land on their intended redirect path
  • Protected routes (/submit, /settings, /admin) still redirect unauthenticated users to /login
  • Open redirect attempts (e.g. ?redirect=//evil.com) fall back to /

Made with Cursor

Sahar Pakseresht and others added 4 commits June 29, 2026 22:23
…dation

Production sign-in skipped onboarding because the Cloudflare x-forwarded-host
rewrite overwrote the redirect path. Enforce handle setup in the proxy, block
open redirects, and verify sessions with getUser() on the server.

Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve proxy redirect cookie forwarding, onboarding profile upsert, and
callback error logging. Add DEVELOPER_HANDOFF_PRODUCT_BUILDERS.md for the
next developer debugging auth on fix/auth.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@SaharPak
SaharPak merged commit 19aaa0f into main Jul 2, 2026
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.

1 participant