You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(courses): use admin client for course mutations to bypass stale JWT RLS
Fixes LMS-FRONT-7C
Root cause: RLS policy on courses table checks get_tenant_role() from JWT
claims, but subdomain tenant users may have stale/missing tenant_role in
their JWT. The server action already validates auth and role server-side
via getUser() + getUserRole() (queries tenant_users directly), so using
createAdminClient() for the actual DB mutation is safe and correct.
Applied to createCourse, updateCourse, archiveCourse, and deleteCourse.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments