Does POSTGREST check if the user ID from JWT exist...
# help
t
Does POSTGREST check if the user ID from JWT exists? Or can I just generate JWT token (signed with the same JWT secret Auth signs it with) with arbitrary ID (taken outside of supabase) and use that? I'd like to manage user accounts outside of supabase and generate tokens only for settings and files (so users can manage only their own stuff)
s
PostgREST only checks if the JWT signature matches the secret. > Or can I just generate JWT token (signed with the same JWT secret Auth signs it with) So yes, you can do that.
t
And I can still use the
auth.uuid()
function in RLS? Does that simply return the `sub`ject from JWT?
s
Yes, if you include the sub claim in your JWT then
auth.uid
will work
t
thanks a lot
s
Passing custom JWT to PostgREST