auth
auth copied to clipboard
fix: allow linking no-email OIDC identity to phone-only users
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
linkIdentityToUser treats an empty primary email as “identity claimed an unverified email,” so phone-only users linking an email-optional OIDC identity with no email hit sendConfirmation and get 422 EmailNotConfirmed.
Fixes #2640
What is the new behavior?
After UpdateUserEmailFromIdentities, email confirmation / Confirm only runs when GetEmail() != "". Anonymous → non-anonymous still runs. Phone-only + no-email OIDC link succeeds.
Additional context
Regression test: TestLinkIdentityToUser_PhoneOnlyNoEmail.