Repository navigation
Ensure email sent to user's stored email - #127388
Merged
Merged
Conversation
oioki
approved these changes
Oct 14, 2026
michelletran-sentry
force-pushed
the
fix/sso-email-identity-handling
branch
from
October 14, 2026 16:35
bc2e386 to
cbb75fc
Compare
resolve_email_to_user() matched addresses with email__iexact, which the database evaluates with its locale-aware UPPER(). That can fold distinct Unicode code points together (e.g. U+0131, U+017F, U+212A), so which account an address resolves to depended on the database collation. Re-filter the candidates with emails_match(), an ASCII-only caseless comparison that never conflates distinct code points, so resolution is deterministic regardless of collation. Co-Authored-By: Claude <[email protected]>
…kups Propagate emails_match() (an ASCII-only caseless comparison) to the other places that resolve an email to a user or member via email__iexact, so none of them depend on the database collation's character folding: - utils.auth.find_users (login / email fallback) - user service get_users and get_user_by_email - organization service check_membership_by_email and get_member Co-Authored-By: Claude <[email protected]>
The one-time account-confirmation link for IdP migration was mailed to the raw email asserted by the SSO identity provider, which need not be an address that belongs to the matched account (account lookup is case-insensitive). Send the link to an address that belongs to the account instead: its verified addresses, or its primary address when none are verified (SSO-provisioned accounts may have no verified email). The asserted email is retained only as the Redis match token checked by has_verified_account, so the migration flow is otherwise unchanged. Add coverage for the send helper and the real SSO pipeline (handle_unknown_identity -> _dispatch_to_confirmation -> send_one_time_account_confirm_link). Co-Authored-By: Claude <[email protected]>
michelletran-sentry
force-pushed
the
fix/sso-email-identity-handling
branch
from
October 14, 2026 16:39
cbb75fc to
c87da40
Compare
michelletran-sentry
enabled auto-merge (squash)
October 14, 2026 16:42
markatsentry
added a commit
that referenced
this pull request
Oct 14, 2026
…rification Follow-up to #127388. Use the same ASCII-only email comparison in the remaining user service lookups and tighten the SSO account confirmation check to the issuing identity.
markatsentry
added a commit
that referenced
this pull request
Oct 14, 2026
…rification Follow-up to #127388. Use the same ASCII-only email comparison in the remaining user service lookups and tighten the SSO account confirmation check to the issuing identity.
markatsentry
added a commit
that referenced
this pull request
Oct 14, 2026
…rification Follow-up to #127388. Use the same ASCII-only email comparison in the remaining user service lookups and tighten the SSO account confirmation check to the issuing identity.
markatsentry
added a commit
that referenced
this pull request
Oct 14, 2026
…rification Follow-up to #127388. Use the same ASCII-only email comparison in the remaining user service lookups and tighten the SSO account confirmation check to the issuing identity.
markatsentry
added a commit
that referenced
this pull request
Oct 14, 2026
…rification Follow-up to #127388. Use the same ASCII-only email comparison in the remaining user service lookups and tighten the SSO account confirmation check to the issuing identity.
3 tasks done
4 tasks
4 tasks
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.
Fix to ensure that we send confirmation email to the user's stored email. Also fixed inconsistencies with email matching.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.