Skip to main content

Module session

Module session 

Source
Expand description

Cookie-session-backed identity for the server-rendered admin UI.

Sessions hold a SessionUser — a lightweight projection-backed POD carrying the aggregate_id UUID, name, and email. Reads from users_view (Step 2 projection); never touches the retired Diesel users table.

Structs§

SessionUser
Identity stored in the cookie session after sign-in.

Functions§

clear_session_user
Wipe identity (sign-out path).
get_session_message
Retrieves and clears the flash message from the session. Returns a tuple of (message_type, message_text) where type is “success” or “error”. Set is_json to true for structured JSON messages (used by the sign-in page).
get_session_user
Read the cached SessionUser.
is_authenticated
true when the cookie session carries a SessionUser.
set_session_user
Cache identity in the session after a successful sign-in or profile change.