fix(auth): preserve the existing Boop account on email login - #235
Merged
Conversation
|
🚅 Deployed to the boop-pr-235 environment in Friends
|
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
Email login now returns users to their existing Boop account when the same email has identities in other apps sharing the Turnkey parent organization. Previously, Boop selected the first global Turnkey email match and created a new local account when that identity differed, making the original lists disappear from view.
Returning users use Boop's saved account link; new users receive a separate identity. Existing duplicate records require an explicit operator selection instead of an arbitrary choice. Pending OTP sessions and user upserts recheck that selection, and conflicting signup sessions cannot insert another user for the same exact email. An undefined DID no longer matches another unfinished signup.
Rollout
Deploy the backend, then use the internal
auth:selectLoginAccountoperation to select the verified original user for each affected email. The operation preserves every user, DID, list, and Turnkey identity. Affected users must sign out and request a fresh OTP; existing JWTs are not revoked. Until selection, duplicate emails receive an account-recovery error.The recovery runbook includes the operator commands and verification steps. This PR does not change production data or merge the duplicate accounts.
Validation