supabase
supabase copied to clipboard
MISSING JWT FIELD DOCUMENTATION
Improve documentation
Add a documentation page for the JWT fields.
Describe the problem
When trying to write a server the JWT need to be serialized. For that, the programmer needs to know the fields, their types and whether they are optional or not.
Additional context
I am authenticating the JWT in Rust and I need to know all the fields and their necessities. Additionally fields like ref
are reserved keywords in Rust and they might pose a problem.
I agree this is an issue. There is more to validation than this, it seems. This may be related: https://github.com/supabase/supabase/issues/26716
Turns out almost everything is optional. All you need is "role". Obviously, that wouldn't be best practices. You should at least include an iat and exp too. See the solution here: https://github.com/supabase/supabase/issues/26716