Add passwordless magic-link sign-up and sign-in#38
Merged
Conversation
Let users sign up and sign in with email only (no password) via a 30-minute magic link, alongside the existing password flow. Passwordless accounts can add a password later from a new account settings page. - Make password_digest nullable; User uses has_secure_password validations: false with its own length/confirmation validations and a :magic_link token tied to password_salt (auto-invalidates on password change) - MagicLinksController + MagicLinkMailer for requesting/consuming sign-in links, with honeypot, rate limiting, org-membership gating, and non-disclosure parity - Users::PasswordsController settings page to add/change a password - Dev-only "Mailer previews" nav link Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds passwordless authentication: users can sign up and sign in with email only, receiving a 30-minute magic link instead of using a password, alongside the existing password flow.
password_digestis now nullable andUsercarries a:magic_linktoken tied topassword_saltso the link auto-invalidates once a password is set or changed. A newMagicLinksController/MagicLinkMailerhandle requesting and consuming sign-in links with honeypot, rate limiting, org-membership gating, and account-existence non-disclosure matching the existing auth controllers. Passwordless users can later add a password from a new account settings page (Users::PasswordsController), and a dev-only "Mailer previews" nav link was added. Full test coverage for the new controllers, mailer, and model behavior is included (103 tests passing, Rubocop and Brakeman clean).🤖 Generated with Claude Code