Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to add providers to an existing user #1048

Closed
globemediaofficial opened this issue Dec 1, 2022 · 4 comments
Closed

No way to add providers to an existing user #1048

globemediaofficial opened this issue Dec 1, 2022 · 4 comments
Labels
auth enhancement New feature or request

Comments

@globemediaofficial
Copy link

With Firebase, I was able to do the following:

final credential = GoogleAuthProvider.credential(idToken: idToken);
//OR OTHER PROVIDERS
final credential = EmailAuthProvider.credential(email: emailAddress, password: password);
//ADD PROVIDER TO CURRENT USER
FirebaseAuth.instance.currentUser?.linkWithCredential(credential);

With Supabase I know these two things; users can be created with OAuth providers and, if the email of that provider user matches an existing user email, the provider is automatically added to that existing user. What I don't know is how to add providers to a user manually. This is a pretty standard feature with authentication on apps. I saw one answer on StackOverflow that suggests it isn't possible on Supabase, because "currently in Supabase email address is the unique identifier of users," but I don't think this is the case. I think this would be a great addition to Supabase Auth (self-hosted).

Example 1:

  1. App requires every user to have an Email & Password
  2. User signs up with phone auth or OAth
  3. User needs to add Email & Password provider to their profile

Example 2:

  1. User signs up with an Email & Password provider
  2. User wants to be able to sign in with OAuth or phone auth
  3. User needs to sign in to OAuth then that provider should be added to the existing Email & Password account, regardless of if the email matches
@globemediaofficial globemediaofficial added the enhancement New feature or request label Dec 1, 2022
@saltcod saltcod added the auth label Dec 20, 2022
@tkrunning
Copy link

I've also run into this issue.

It seems it's currently supported that OAuth and email address don't match (e.g. if you change the account email after the OAuth provider is connected, you can still log in with the provider), but it's not a good workaround to ask users to temporarily change their account email address to the one matching their OAuth provider before adding it.

@kiwicopple kiwicopple transferred this issue from supabase/supabase Jan 20, 2023
@J0 J0 transferred this issue from supabase/auth Apr 10, 2023
@J0 J0 transferred this issue from supabase/auth Apr 10, 2023
@hf
Copy link
Contributor

hf commented Jun 7, 2023

This is one of the highest priorities for the team in the coming period. Watch this space. Somewhat related to #68.

@hf
Copy link
Contributor

hf commented Jun 7, 2023

Actually, a duplicate of #313.

@hf hf closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2023
@globemediaofficial
Copy link
Author

@hf Since this issue was closed as "not planned," is this no longer a priority for the team? I'm confused because you said this issue was one of the highest priorities for the team and then closed it as not planned on the same day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants