Appearance
apps/web/src/hooks/usePlatformSession.ts ​
Auto-generated by
scripts/generate-file-docs.ts. Do not edit — overwritten on every run.
Purpose ​
usePlatformSession — exchanges a fresh Clerk token for a platform session status immediately after social sign-in. POST /api/v1/auth/session provisions the Users row on first sign-in (status=pending_approval) and returns the current status on subsequent sign-ins. The web app uses the returned status to route the user: - active → /app/home (ProtectedApp renders children) - pending_approval → /pending (ProtectedApp redirects) - suspended/deactivated → /sign-in with error The Clerk token is NOT the platform session token. The platform sessionToken returned here is used only if the caller needs to call endpoints that require it explicitly. Subsequent API calls send the Clerk JWT directly (see api.ts — requireAuth handles both). AB#3710 (A1), AB#3712 (A3), AB#3714 (A5) /
Exports ​
export type PlatformStatusexport interface PlatformSessionexport function usePlatformSession
Imports ​
../lib/api@clerk/react@tanstack/react-query
Imported by ​
(not referenced in graph, or graph not yet generated)