Skip to content

feat(oauth): allow syncing of email address changes from oauth providers - #2706

Open
ftyl wants to merge 3 commits into
supabase:masterfrom
ftyl:feat/oauth_email_sync
Open

feat(oauth): allow syncing of email address changes from oauth providers#2706
ftyl wants to merge 3 commits into
supabase:masterfrom
ftyl:feat/oauth_email_sync

Conversation

@ftyl

@ftyl ftyl commented Aug 18, 2026

Copy link
Copy Markdown

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.

@ftyl
ftyl requested a review from a team as a code owner August 18, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant