auth icon indicating copy to clipboard operation
auth copied to clipboard

Inconsistent 'signup disabled' errors

Open magdalipka opened this issue 1 year ago • 0 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When signups are disabled and user tried to sign up, some auth methods return information about signups being disabled, some fail with internal server error.

To Reproduce

When signups are disabled (by [auth.enable_signup] set to true in config.toml):

  • calling auth.signUp with email+password input (from @supabase/supabase-js)//signup (in supbase/auth repository) throws error:
Signups not allowed for this instance
  • calling auth.signInWithOAuth//callback with Google provider redirects back to the page with parameters:
?error=access_denied&error_code=422&error_description=Signups+not+allowed+for+this+instance
  • calling auth.signInWithIdToken//token?grant_type=id_token with Google provider (as described here ) throws:
"name":"AuthApiError","message":"Internal Server Error", "status":400

I suspect this is due to createAccountFromExternalIdentity throwing unprocessableEntityError and token login handler forwarding this as Internal Server Error

Expected behavior

The endpoint /token?grant_type=id_token to pass the unprocessableEntityError to the client with message about signups being disabled.

System information

  • OS: macOS
  • Version of supabase-js: 2.43.6
  • Version of auth-js: 2.64.2
  • Version of supabase-cli: 1.172.2
  • Version of Node.js: 20.11.1

magdalipka avatar Jul 24 '24 14:07 magdalipka