feat(oauth): allow syncing of email address changes from oauth providers - #2706
Open
ftyl wants to merge 3 commits into
Open
feat(oauth): allow syncing of email address changes from oauth providers#2706ftyl wants to merge 3 commits into
ftyl wants to merge 3 commits into
Conversation
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.
feat(oauth): allow syncing of email address changes from oauth providers
Problem
Currently email changes are updated in the identity's data and raw meta data but not the actual users.email field. This means that if someone for example logs in via Google OAuth and their Google email address is modified, this change is never reflected in the local database and emails sent will still go to the old Google email address possibly resulting in lost emails and de-synced contact records.
Solution
Add config variable SyncEmail to all OAuth providers, including custom ones. When true on each successful login
check if the email address has changed on the provider's side. If changed and no email specific identity provider
is present for this user, the users.email field is updated to the new email provided by the OAuth provider.
Email conflicts are simply logged, but the login proceeds as normal, resulting in the exact same behaviour as present already today.