Loading…
/profile is the personal identity page — deliberately outside the
workspace nav. It has no requirePermission gate because it shows the
caller's own data: a client page merges the live Clerk session (useUser)
with the Mongo user record from GET /api/user/profile (role,
additionalRoles, isSuperAdmin, 2FA state, activity timestamps,
profile fields) and links out to role-appropriate admin areas.
| Route | Purpose | Guard |
|---|---|---|
/profile | Identity card — contact, org/role, security status, admin shortcuts | Signed-in user only (no permission required) |
/profile/manage | Clerk UserProfile widget (path routing, themed via useClerkAppearance) | Signed-in user only |
/profile/manage/security | Clerk security tab (same widget, security path) | Signed-in user only |
manage/layout.tsx is a client layout rendering the Identity & Security
header, Profile/Security tabs, and a "Return to Profile" back link.
| Method | Path | Guard | Purpose |
|---|---|---|---|
GET | /api/user/profile | Clerk auth() session | Merged Clerk + Mongo profile record |
PATCH | /api/user/profile | Clerk auth() session | Update own editable profile fields |
All writes go through the Clerk widget or the session-scoped PATCH above —
there is no admin checkRole on these endpoints because the scope is always
"self".