Repository navigation
Let users change their sign-in email in the settings - #129
Merged
Merged
Conversation
A new "Email address" card on the settings page changes the address an account signs in with, confirmed by the current password so it works on instances without SMTP. The previous address gets a security notice when mail is configured; the change stands even if that notice fails. Accounts created through single sign-on have no password and their address belongs to the identity provider, so they see it read-only. Attempts are rate-limited per account, since the form checks a password. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LUaD2yecLFtn7HfUGeaRWR
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.
Summary
Adds an Email address card to the settings page so users can change the address they sign in with.
passwordHash === SSO_ONLY_PASSWORD_HASH): the address is shown read-only with a hint that the identity provider manages it. The server action also refuses these accounts (ssoManaged).RATE_LIMITS.emailChange(5 per 15 min, per account, stored in the database with an in-memory fallback), because the form checks a password.emailTaken, and an unchanged address returnssameEmail.mail.ts: SMTP transport setup moved into a sharedmailTransport()helper, plus the newsendEmailChangedMail.settings.email.No schema change or migration.
Known limitation
Without a confirmation link, nobody checks that the user owns the new address. If OIDC is configured, a user with a password account could set their address to someone else's IdP email. If that person then signs in through SSO for the first time, the email match would link them to this account. They would get into the other user's account, not the other way round. The confirmation-link option was considered and not chosen for now.
Test plan
npm run typecheckeslinton changed filesvitest run: all pass, including the newsrc/server/profile-actions.test.ts(success, wrong password, SSO refusal, taken address, invalid or unchanged address, notice failure, rate limit)🤖 Generated with Claude Code
https://claude.ai/code/session_01LUaD2yecLFtn7HfUGeaRWR
Generated by Claude Code