ui/client/features/auth/hooks/useAuthSession
Cockpit client (features), next. Source: ui/client/features/auth/hooks/useAuthSession.tsx.
Functions#
AuthSessionProvider()#
AuthSessionProvider(
__namedParameters):Element
Defined in: ui/client/features/auth/hooks/useAuthSession.tsx:31
One session fetch for the whole app, shared by the gate and the top bar's user menu — unlike project-gate (which each gated route mounts for itself), there is exactly one answer to "who is signed in" per browser tab, and two components need it at once.
Mounted in the root layout above ShellController, so the login screen can replace the entire Cockpit frame rather than appearing inside it.
Parameters#
__namedParameters
children
ReactNode
Returns#
Element
useAuthSession()#
useAuthSession():
AuthSessionValue
Defined in: ui/client/features/auth/hooks/useAuthSession.tsx:83
Current session plus the sign-in/sign-out actions. Throws outside the provider rather than silently reporting "logged out", which would be a security-shaped lie in a component that decides what to render.
Returns#
AuthSessionValue