Update the auth plugin to use profile.id UUID as userContext.userId instead of raw JWT sub. Update admin guard to query by user_profile_id.
Files
backend/src/core/plugins/auth.plugin.ts
backend/src/core/plugins/admin-guard.plugin.ts
Key Changes
auth.plugin.ts: Rename userId to auth0Sub for JWT sub. After getOrCreate, set userId = profile.id
admin-guard.plugin.ts: Query WHERE user_profile_id = $1 instead of WHERE auth0_sub = $1
Acceptance Criteria
userContext.userId contains UUID format after authentication
Admin guard correctly identifies admin users by UUID
Auth0 Management API calls still work (use raw JWT sub)
Relates to #206
## Milestone 2: Auth plugin and admin guard
Update the auth plugin to use profile.id UUID as userContext.userId instead of raw JWT sub. Update admin guard to query by user_profile_id.
### Files
- `backend/src/core/plugins/auth.plugin.ts`
- `backend/src/core/plugins/admin-guard.plugin.ts`
### Key Changes
- auth.plugin.ts: Rename `userId` to `auth0Sub` for JWT sub. After getOrCreate, set `userId = profile.id`
- admin-guard.plugin.ts: Query `WHERE user_profile_id = $1` instead of `WHERE auth0_sub = $1`
### Acceptance Criteria
- [ ] userContext.userId contains UUID format after authentication
- [ ] Admin guard correctly identifies admin users by UUID
- [ ] Auth0 Management API calls still work (use raw JWT sub)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Relates to #206
Milestone 2: Auth plugin and admin guard
Update the auth plugin to use profile.id UUID as userContext.userId instead of raw JWT sub. Update admin guard to query by user_profile_id.
Files
backend/src/core/plugins/auth.plugin.tsbackend/src/core/plugins/admin-guard.plugin.tsKey Changes
userIdtoauth0Subfor JWT sub. After getOrCreate, setuserId = profile.idWHERE user_profile_id = $1instead ofWHERE auth0_sub = $1Acceptance Criteria