Skip to content

Return consistent redirect on duplicate registration - #213

Open
SakusenSec wants to merge 1 commit into
basecamp:mainfrom
SakusenSec:consistent-registration-redirect
Open

Return consistent redirect on duplicate registration#213
SakusenSec wants to merge 1 commit into
basecamp:mainfrom
SakusenSec:consistent-registration-redirect

Conversation

@SakusenSec

Copy link
Copy Markdown

When a user attempts to register with an email address that is already taken, the RecordNotUnique rescue redirects to /session/new?email_address=. A successful registration redirects to /. The differing redirect targets reveal whether an address is registered.

This PR removes the email_address parameter from the duplicate-registration redirect, making both paths return an opaque redirect without leaking registration state. The existing-user flow still lands on the sign-in page; it just no longer pre-fills the email field.

Copilot AI review requested due to automatic review settings June 15, 2026 20:33

@claude claude Bot 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adjusts the users signup flow by changing the redirect behavior when a RecordNotUnique error occurs (likely when a user attempts to sign up with an email that already exists).

Changes:

  • Remove passing email_address as a query param when redirecting to the login page after ActiveRecord::RecordNotUnique.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

redirect_to root_url
rescue ActiveRecord::RecordNotUnique
redirect_to new_session_url(email_address: user_params[:email_address])
redirect_to new_session_url
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.

2 participants