DEV Community

Discussion on: Supabase Custom Claims

Collapse
 
jerzakm profile image
Martin J • Edited

I just started diving into supabase and pgsql for the first time and I think I'm going to use it.

What about this for notifying a webapp user that a server changed their claim:

  • Make a table 'userClaimHash' where id is userID (and RLS read constraint) and hash column is either uuid or just autoincrementing int
  • Make a trigger to update userClaimHash whener claim is changed
  • Subscribe to userClaimHash and call supabase.auth.update({}) on change
Collapse
 
burggraf profile image
Mark Burggraf

Pretty cool solution!