r-paxst
r-paxst

Reputation: 1

Update User with Automatic Linking & OAuth

I am getting this error when attempting to update a user's email when that user is logged into multiple sign in methods (email + OAuth). I do not want to turn on Manual Linking as I like that users can sign in via multiple providers and it automatically links them to their existing account. I also tried without unlinking identities and got the second error below.

Is there any way to keep automatic linking on and also allow users to update their email?

With Unlink Identities Error: 404: Manual linking is disabled Without Unlink Identities Error: ERROR: record "new" has no field "user_id\

` final identities = await supabase.auth.getUserIdentities(); // Only unlink social providers, not the primary email identity for (var identity in identities) { // Skip the email provider/primary identity if (identity.provider != 'email') { print('Unlinking provider: ${identity.provider}'); await supabase.auth.unlinkIdentity(identity); } }

await supabase.auth.updateUser( emailRedirectTo: 'https://example.com/auth/callback', // Replaced with generic URL UserAttributes( email: '[email protected]', // uses my email controller ), ); `

Tried with and without unlink identities.

Upvotes: 0

Views: 9

Answers (0)

Related Questions