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

Cannot Use Both Email and Phone Providers Simultaneously #1840

Open
MuddasirAlgoace opened this issue Nov 13, 2024 · 2 comments
Open

Cannot Use Both Email and Phone Providers Simultaneously #1840

MuddasirAlgoace opened this issue Nov 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MuddasirAlgoace
Copy link

I am trying to register a user using both email and phone authentication in Flutter app with Supabase, but encountering the following error:

149 - assert((email != null && phone == null) || (email == null && phone != null),
150 - 'You must provide either an email or phone number');
This error arises because Supabase currently enforces a condition where only one of either email or phone is provided for user signup. However, I want to allow both email and phone parameters to be provided simultaneously, as it would make verification easier before future authentications.

Is there a way to modify or extend the logic in Supabase to support both email and phone authentication providers during signup? and their provider must be working on login seprately.

pos: I am using twilio provider for phone

@J0
Copy link
Contributor

J0 commented Nov 14, 2024

This error arises because Supabase currently enforces a condition where only one of either email or phone is provided for user signup. However, I want to allow both email and phone parameters to be provided simultaneously, as it would make verification easier before future authentications.

Hey!

Thanks for the query, unfortunately this is right - we only allow signup with one method at a time (e.g. signUp({phone, password}) or signUp({email,password}) You can create an account with email and add a phone number via updateUser though or vice versa.

and their provider must be working on login seprately.

To clarify, is the team hoping to have two separate accounts? (e.g. email would be one account, and phone on another). For that scenario it's possible to call sign up twice (first with phone, second with email) and there should be two separate accounts.

Let us know

@MuddasirAlgoace
Copy link
Author

@J0 Can you please share an example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants