Skip to content

fix(auth): guard verify page and correct signup OTP flow#36

Open
omarelkhal wants to merge 1 commit into
revokslab:mainfrom
omarelkhal:fix/verify-page-guards
Open

fix(auth): guard verify page and correct signup OTP flow#36
omarelkhal wants to merge 1 commit into
revokslab:mainfrom
omarelkhal:fix/verify-page-guards

Conversation

@omarelkhal
Copy link
Copy Markdown

Summary

  • Cold /verify?fromSignup=true: redirect to /register when there is no verificationEmail in sessionStorage and no session email (fixes empty “sent to your email” dead-end).
  • Signup OTP: auto-send email-verification OTP on mount; resend uses the same type from fromSignup.
  • Verify API: use client.emailOtp.verifyEmail() for signup, not client.signIn.emailOtp().
  • Already verified: server redirect to /dashboard when emailVerified is true.
  • UX: loading state until context is ready; “Back to signup” links to /register (not /signup).
  • Local dev (auth.ts): fix inverted useSecureCookies / crossSubDomainCookies; log OTP to console when EMAIL_PROVIDER=log (matches docs).

Test plan

Manual (port 3002, EMAIL_PROVIDER=log, Postgres shipfree DB):

  1. New tab → http://localhost:3002/verify?fromSignup=true → must land on /register.
  2. Register → /verify?fromSignup=true shows your email; terminal logs 🔑 VERIFICATION CODE with type: email-verification.
  3. Enter OTP → /dashboard with session cookies set.

Automated check used Playwright against the above (all passed on fix/verify-page-guards).

Related

Separate branch fix/unverified-email-recovery — do not merge into this PR.

Upstream issue body: ISSUE-verify-page.md in shipfree-contribution/.

Redirect cold /verify visits without context to /register, send the
correct email-verification OTP on load, and verify signup with
emailOtp.verifyEmail instead of signIn.emailOtp. Also fix inverted dev
cookie settings and log OTPs when using the log email provider so local
testing matches the docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

@omarelkhal is attempting to deploy a commit to the Revoks Lab Team on Vercel.

A member of the Team first needs to authorize it.

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