Category: Supabase and databases

Supabase JWT: new roles do not appear in active token

Read this guide in Polish

After changing the role in the database, the user still receives a refusal or retains the old permission.

How to identify the source of the problem

Check the claim source and the time the access token is displayed relative to the permission change.

Compare the result for the authorized and unauthorised user, project name and exact error code.

Repair steps

Force the session to refresh correctly, and critically control the database side on the current data.

How to Test Solution

The change of role operates in accordance with the established security policy, without relying on the old JWT.

Security and restrictions

Change permissions and scheme first on test data with backup. Do not put service role in your browser.