supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
703 stars 167 forks source link

[AuthExeption] anonymous sign-ins are disabled #877

Closed hamzabouakoura closed 5 months ago

hamzabouakoura commented 5 months ago

Hi , I'm new to supabase and i was trying to use it for authentication with my flutter app Therefore i used signup() method to create a new user , but it is not working and I'm getting the exeption above .

Any ideas ?

dshukertjr commented 5 months ago

Could you provide step by step of what you did? I didn't get the error you are getting by calling the following on a fresh Supabase project.

await supabase.auth.signUp(email: 'my@email.com', password: 'password');
hamzabouakoura commented 5 months ago

@dshukertjr

Well simply, i created the the following method and called it in the onPressed in order to create a new user :

Future<AuthResponse> signUpUser(
  {required String email, required String password}) async {
  final response = await Supabase.instance.client.auth.signUp(
    email: email,
    password: password,
  );
  return response;
}

But i'm getting the AuthExeption(anonymous sign-ins are disabled).

It's not supposed to give this error cuz i'm using the signUp() method which creates a normal user that need to confirm his email , isn't it ?

dshukertjr commented 5 months ago

@hamzabouakoura Could you try to call the signUp method with hard-coded values something like the following and see if you get the same error?

await Supabase.instance.client.auth.signUp(
  email:'sample@gmail.com',
  password: 'password',
);
hamzabouakoura commented 5 months ago

@dshukertjr Yes , it's working.

The problem was stupid mistake on my part on passing the controllers to the method

Thanks a lot for your help Tayler 🙏