Line

You are reading docs for v0.8. See latest (v0.9)

ui/client/features/auth/services/AuthApi

Cockpit client (features), v0.8. Source: ui/client/features/auth/services/AuthApi.ts.

Functions#

fetchSession()#

fetchSession(): Promise<AuthSession>

Defined in: ui/client/features/auth/services/AuthApi.ts:18

Real network I/O for the session itself (SERVICE-*); the two ways of starting a login live in AuthLogin.ts.

Every call here is credentialed: the session cookie is set by ui/server on :4000 and the Cockpit is served from :3000, so without credentials: 'include' the browser sends no cookie and a logged-in user looks logged out.

The two ports are the same site (localhost), which is why a SameSite=Lax cookie travels between them at all — see the note in ui/server/src/auth.mjs about serving client and server from the same site when this is deployed anywhere other than a developer's machine.

Returns#

Promise<AuthSession>


logout()#

logout(): Promise<void>

Defined in: ui/client/features/auth/services/AuthApi.ts:23

Returns#

Promise<void>