Skip to content

Sign-up with existing email: clear duplicate error instead of false success - #25

Merged
KrishP147 merged 2 commits into
mainfrom
krish/fix-signup-existing-email
Sep 24, 2026
Merged

KrishP147 merged 2 commits into
mainfrom
krish/fix-signup-existing-email

Conversation

@KrishP147

Copy link
Copy Markdown
Owner

Fixes #4

  • isExistingAccount(user, now): identities [] (confirmed duplicate) or created_at older than 5 min (unconfirmed duplicate) -> duplicate; missing/unparseable fields -> new account. Threshold is generous on purpose: a false already-exists for a real new user is worse than missing a minutes-old duplicate.
  • One message: An account with this email already exists - log in or reset your password, with links to /login?email= and /forgot-password (errorKind flag replaces substring matching).
  • Success copy now says you are signed in and taken to the dashboard (emailRedirectTo is /dashboard).
  • Tests: +8 (confirmed dup, unconfirmed dup, fresh signup, helper unit tests).

Login ?email= prefill lands with #9.

🤖 Generated with Claude Code

KrishP147 and others added 2 commits September 23, 2026 22:31
Add isExistingAccount() helper: confirmed dupes via empty identities[],
unconfirmed dupes via created_at older than 5min. Unify duplicate-email
copy w/ login+reset-password links; fix success copy to match dashboard
redirect.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
isExistingAccount/consts are non-component exports needed by tests;
matches disable pattern already used in FastingContext/GoalsContext.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nutrisync-frontend Ready Ready Preview Sep 24, 2026 3:09am UTC

Copilot AI lite review requested due to automatic review settings September 24, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KrishP147
KrishP147 merged commit 54d6a2d into main Sep 24, 2026
9 checks passed
@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.16667% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/pages/Register.jsx 79.16% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch was successfully deployed

1 active deployment
Preview — 92a87bc3 Deployed Sep 24, 2026 by vercel[bot]
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.

Sign-up with an existing email shows false 'Check your email' success

2 participants