AuthSessionStore¶
Import: import system.webapi.auth;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
AuthSessionStore¶
Persistence operations must be atomic, including refresh replay detection and transaction consumption.
create¶
Stores a new refresh session; returns an error if its token hash already exists.
find¶
Finds an unexpired session at epoch-second time now; rejects revoked or missing sessions.
rotate¶
Consumes a refresh session and stores its replacement. Replay revokes the family; invalid replacements return an error.
async unique fun rotate(
hash: string,
replacement: AuthSession,
now: long
): Result<AuthSession, AuthError>
revoke¶
Revokes all refresh sessions in family.
active¶
Returns whether family has an unexpired, unconsumed session at epoch-second time now.
put_transaction¶
Stores a login transaction under state; duplicate state returns an error.
async unique fun put_transaction(
state: string,
transaction: OidcTransaction
): Result<Unit, AuthError>
take_transaction¶
Removes and returns the login transaction. Missing or expired state returns an error.