Skip to main content

Module session_auth

Module session_auth 

Source
Expand description

Shared login / register / session probe for CLI and gfx clients.

Functionsยง

has_api_token
True when an API token is set (skip interactive onboarding).
login
POST /v1/auth/login and save SessionConfig + SavedLogin.
login_default
Login using the default API base from client config / env.
logout
Revoke the control-plane session (best-effort) and delete local session.json. Keeps SavedLogin so the next login form can autofill.
needs_interactive_login
Interactive login/register is needed when there is no usable session/API token.
register
POST /v1/auth/register, then login.
register_default
Register using the default API base from client config / env.
session_is_valid
Probe control plane: env API token, or GET /v1/me with the saved session.
try_restore_expired_session
When session.json exists but the server rejected the token (common after Redis/dev restarts), re-login with SavedLogin credentials.