ui/client/features/auth/workflows/AuthSession
Cockpit client (features), next. Source: ui/client/features/auth/workflows/AuthSession.ts.
Type Aliases#
AuthSessionAction#
AuthSessionAction = {
type:"LOAD_START"; } | {session:AuthSession;type:"LOADED"; } | {message:string;type:"LOAD_FAILED"; } | {type:"SIGN_IN_START"; } | {message:string;type:"SIGN_IN_FAILED"; }
Defined in: ui/client/features/auth/workflows/AuthSession.ts:32
AuthSessionState#
AuthSessionState =
object
Defined in: ui/client/features/auth/workflows/AuthSession.ts:27
Properties#
load
load:
SessionLoad
Defined in: ui/client/features/auth/workflows/AuthSession.ts:28
signIn
signIn:
SignInState
Defined in: ui/client/features/auth/workflows/AuthSession.ts:29
SessionLoad#
SessionLoad = {
status:"loading"; } | {session:AuthSession;status:"ready"; } | {message:string;status:"unreachable"; }
Defined in: ui/client/features/auth/workflows/AuthSession.ts:16
The answer to "who is signed in": still asking, told, or could not ask.
"Still asking" vs "asked, and you are logged out" is what keeps the login
screen from flashing over an already-authenticated Cockpit. unreachable
(/auth/session itself failed) is a different problem from being logged
out, and is shown differently.
SignInState#
SignInState = {
status:"idle"; } | {status:"signing-in"; } | {message:string;status:"failed"; }
Defined in: ui/client/features/auth/workflows/AuthSession.ts:22
In-flight state of the login screen's button.
Variables#
initialAuthSessionState#
constinitialAuthSessionState:AuthSessionState
Defined in: ui/client/features/auth/workflows/AuthSession.ts:39
Functions#
authSessionReducer()#
authSessionReducer(
state,action):AuthSessionState
Defined in: ui/client/features/auth/workflows/AuthSession.ts:48
Parameters#
state
action
Returns#
isLoadingSession()#
isLoadingSession(
state):boolean
Defined in: ui/client/features/auth/workflows/AuthSession.ts:73
True until the first (or a repeated) /auth/session answer lands.
Parameters#
state
Returns#
boolean
isSigningIn()#
isSigningIn(
state):boolean
Defined in: ui/client/features/auth/workflows/AuthSession.ts:79
True while the login screen's own button is in flight.
Parameters#
state
Returns#
boolean
sessionOf()#
sessionOf(
state):AuthSession|null
Defined in: ui/client/features/auth/workflows/AuthSession.ts:70
The session once the server has answered; null while asking or when it could not be reached.
Parameters#
state
Returns#
AuthSession | null
signInError()#
signInError(
state):string|null
Defined in: ui/client/features/auth/workflows/AuthSession.ts:82
The last sign-in failure, for the login screen; null when there is none.
Parameters#
state
Returns#
string | null
unreachableMessage()#
unreachableMessage(
state):string|null
Defined in: ui/client/features/auth/workflows/AuthSession.ts:76
Why /auth/session could not be reached; null otherwise.
Parameters#
state
Returns#
string | null