jan-zabloudil / release-manager

Platform-agnostic tool that streamlines daily operations in release management, planning and deployments 🚀
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

feat: add endpoint to fetch authenticated user information #156

Closed jan-zabloudil closed 2 months ago

jan-zabloudil commented 2 months ago

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.