Skip to content

fix(auth): signup no longer falsely says "already registered"#12

Merged
ralyodio merged 1 commit into
masterfrom
fix/signup-enumeration
Jun 12, 2026
Merged

fix(auth): signup no longer falsely says "already registered"#12
ralyodio merged 1 commit into
masterfrom
fix/signup-enumeration

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Signup returned "This email is already registered" for every email, including brand-new ones.

Cause

With email confirmation on, Supabase deliberately returns an identical response for new and existing emails (no error, no session, user: null via supabase-js) to prevent email enumeration. The route's heuristic treated that shape as "already registered" and 409'd every signup — while the confirmation email was actually being sent (hence users still got the email).

Fix

Drop the impossible new-vs-existing detection. On a successful signUp with no session, return needsEmailConfirmation: true (the signup page already shows "Check your email to confirm"). A present session still logs the user in immediately.

Verified against the live Supabase project: both a fresh email and anthony@profullstack.com return { user: null, session: null, error: null }.

🤖 Generated with Claude Code

With email confirmation enabled, Supabase returns an IDENTICAL response for a
brand-new email and an already-registered one (no error, no session, null user
via supabase-js) — by design, to prevent email enumeration. The previous
heuristic treated that null-user/no-session shape as "already registered" and
409'd EVERY signup, even though the confirmation email was actually sent.

Remove the impossible detection: when signUp succeeds with no session, just
report needsEmailConfirmation (the signup page already shows "check your email").
A returned session still signs the user in immediately.

Verified against the live project: a fresh email and an existing one both return
{ user: null, session: null, error: null } via supabase-js.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ralyodio ralyodio merged commit 6b54c94 into master Jun 12, 2026
5 checks passed
@ralyodio ralyodio deleted the fix/signup-enumeration branch June 12, 2026 14:36
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

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