Closed 842u closed 3 months ago
After some research it turns out that in GoTrue API signup there is a check not only if email confirmation is enabled but also if phose confirmation is enabled:
Following this, there are gaps in documentation and inconsistencies in default configurations when using Supabase platform compared to self-hosting Supabase manualy with Docker or using Supabase CLI.
Default configurations:
Supabase platform
Email provider enabled & Email confirmation enabled
Phone provider disabled & Phone confirmation enabled
Supabase self-hosting with Docker
Email provider enabled & Email confirmation enabled .env.example
Phone provider enabled & Phone confirmation disabled .env.example
Supabase CLI
Email provider enabled & Email confirmation disabled
[auth.email]
enable_signup = true
enable_confirmations = false
Phone provider enabled & Phone confirmation disabled
[auth.sms]
enable_signup = true
enable_confirmations = false
So to make it work as expected, it's necessary to explicitly set up not only email confirmations but also phone confirmations, even if the phone provider is not used for signing up.
Bug report
Describe the bug
Developing localy with
auth.email.enable_confirmations=true
, callingsignUp()
for existing confirmed user responds with an error'User already registered'
. However, in production,signUp()
behaves as expected: it succeeds and returnsdata
, as mentioned in the docs:To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Call
signUp()
first timeconst response = await supabase.auth.signUp({ email, password });
Confirm email
Call
signUp()
for existing confirmed emailconst response = await supabase.auth.signUp({ email, password });
response
will containerror
but nodata
{ data: { user: null, session: null }, error: { message: 'User already registered', status: 400 }}
Expected behavior
The behavior of signUp() will be the same in both local development and production.
System information
Additional context
https://github.com/supabase/supabase/issues/18195 might be connected.