User information can be accessed via endpoints provided by Supabase. While the existing endpoints provide data from auth.users, a new endpoint has been added to retrieve custom user parameters stored in public.users (such as role).
An alternative approach would be to store custom parameters also in the auth.users table. If this method is preferred in the future, it can be implemented using: https://github.com/supabase-community/supabase-custom-claims. This approach allows these parameters to be included directly in the JWT token.
But if this solution were chosen, the user's custom parameters would also need to be saved in both the public.users table and the auth.users table.
However, in the current client implementation (using Retool), it seems easier to simply call the REST endpoint to retrieve user information rather than extracting it from the JWT token.
User information can be accessed via endpoints provided by Supabase. While the existing endpoints provide data from
auth.users
, a new endpoint has been added to retrieve custom user parameters stored inpublic.users
(such as role).An alternative approach would be to store custom parameters also in the
auth.users
table. If this method is preferred in the future, it can be implemented using: https://github.com/supabase-community/supabase-custom-claims. This approach allows these parameters to be included directly in the JWT token. But if this solution were chosen, the user's custom parameters would also need to be saved in both the public.users table and the auth.users table.However, in the current client implementation (using Retool), it seems easier to simply call the REST endpoint to retrieve user information rather than extracting it from the JWT token.