auth icon indicating copy to clipboard operation
auth copied to clipboard

Removing GOTRUE_JWT_DEFAULT_GROUP_NAME results in: role "" does not exist

Open Obeyed opened this issue 1 year ago • 3 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 GOTRUE_JWT_DEFAULT_GROUP_NAME=authenticated environment variable is not set then newly created users will have an empty role which breaks assumptions and results in role "" does not exist when postgrest and the database try to look up the role.

There is a deprecation warning regarding GOTRUE_JWT_DEFAULT_GROUP_NAME but removing it seems to break things. What's the correct solution if this environment variable is being removed in the near future?

To Reproduce

Don't set the GOTRUE_JWT_DEFAULT_GROUP_NAME=authenticated environment variable and invite a new user. The role column in the auth.users table will be empty.

Expected behavior

The role column is expected to be set otherwise

Additional context

Tried with docker image supabase/gotrue:v2.132.0

There is an old issue related to this that was closed by the auther, see: https://github.com/supabase/gotrue/issues/948

Obeyed avatar Dec 22 '23 11:12 Obeyed

Hey the notice is really about not using that with a custom role for now. It will be using authenticated or there'll be another way to define roles in the future.

hf avatar Jan 09 '24 15:01 hf

I will fix the issue for removing it.

hf avatar Jan 09 '24 15:01 hf

Do we have any updates on this issue? This deprecation was introduced two years ago #599 and there is no other option to set default role during user registration/creation (except manual change in database or through the admin API).

@hf What was the purpose of marking it as deprecated if there is no other way to configure it? My understanding is that it should not be marked as deprecated until the new/other way of configuration will be available. This change is very confusing and is raising a lot of questions when we dive into logs.

JavertArdo avatar Sep 03 '24 15:09 JavertArdo