© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
8 replies
lawnday

Forcing JWT refresh after setting custom claims

Hey folks! I'm using https://github.com/supabase-community/supabase-custom-claims to set custom claims in my JWT for integration with another service (Hasura). I have a database trigger that sets the claim whenever a new user is inserted. This works fine, but when creating an account using
supabase.auth.signUp
supabase.auth.signUp
, I get the session data with an initial JWT back immediately, before the trigger runs. Is there any way to force a refresh of the JWT so that I get a version with the new claim in it? Right now, I'm only able to get it working by logging out and logging back in again. I've tried a few combinations of
setSession
setSession
,
updateUser
updateUser
, etc, but I only ever get the initial JWT back.
GitHub
GitHub - supabase-community/supabase-custom-claims: How to implemen...
How to implement custom claims with Supabase. Contribute to supabase-community/supabase-custom-claims development by creating an account on GitHub.
GitHub - supabase-community/supabase-custom-claims: How to implemen...
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

JWT refresh
SupabaseSSupabase / help-and-questions
8mo ago
how to add data in custom claims of jwt
SupabaseSSupabase / help-and-questions
2w ago
JWT custom claims: Am I making the right choice?
SupabaseSSupabase / help-and-questions
4w ago
Custom claims package
SupabaseSSupabase / help-and-questions
4y ago