Injects tenant ID and RBAC permissions into JWT via Postgres Auth Hooks during token issuance.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
anon, authenticated, or public roles. Execution MUST be restricted to supabase_auth_admin.jsonb_set. Malformed claims corrupt all downstream RLS.supabase-mcp-verification is not installed or not passing.custom_access_token_hook) to inject permissions at token issuance time.jsonb_set to write tenant_id and permissions into event->'claims'->'app_metadata'.SECURITY DEFINER to access role tables regardless of caller context.auth.jwt() -> 'app_metadata' ->> 'tenant_id' — not from direct table JOINs.EXECUTE only to supabase_auth_admin and explicitly REVOKE from public.event object preserves the original structure with only claims.app_metadata modified.