Handles account management and session lifecycle. Sessions are stored in SQLite and mirrored in an in-memory cache for fast token lookups. Expired sessions are purged from both on construction and on access.
Private
if the username is already taken.
Deletes an account and invalidates all its active sessions.
if the user does not exist.
Validates a token and returns public session info, or null if missing or expired.
null
Returns a new session on success, null on bad credentials (never throws).
Handles account management and session lifecycle. Sessions are stored in SQLite and mirrored in an in-memory cache for fast token lookups. Expired sessions are purged from both on construction and on access.