Commit 4126123
fix(auth): set app_metadata.tenant_id in joinCurrentSchool action
New users joining a school via /join-school had null tenant_id in
app_metadata, so the JWT hook couldn't inject tenant claims. Client-side
exam submissions then failed RLS (get_tenant_id() returned wrong tenant).
Fix: set app_metadata.tenant_id via admin client before refreshing the
session, same pattern as create_school RPC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 957698f commit 4126123
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
0 commit comments