Commit 75c1b35
fix(db): grant supabase_auth_admin access to tenant_users + set hook SECURITY DEFINER
The custom_access_token_hook was not SECURITY DEFINER and
supabase_auth_admin lacked SELECT on tenant_users/super_admins.
This caused the hook to silently fail (WHEN OTHERS handler),
so JWTs never got tenant_id/tenant_role claims — breaking all
RLS policies for every user.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3f3ff8b commit 75c1b35
1 file changed
Lines changed: 19 additions & 0 deletions
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments