Skip to main content

Module helpers

Module helpers 

Source
Expand description

Shared helpers for plugin implementations.

Extracted to avoid duplicating common patterns across plugins (DRY).

Structs§

IssuedSession
Result of issuing a real session for a user.

Enums§

SessionIssueError
Session issuance failures that callers may need to surface differently from a generic auth error (for example OAuth callback redirects).

Functions§

admin_banned_user_message
Resolve the configured message shown when a banned user attempts to create a session.
admin_plugin_enabled
Whether the admin plugin is active for this auth instance.
apply_default_role
Apply the configured default admin role to a new user when the caller didn’t set an explicit role.
delete_session_cookie_headers
TS-style cookie clearing used by deleteSessionCookie.
expires_in_to_at
Convert an expiresIn value (seconds from now) into an RFC 3339 expires_at timestamp string.
get_cookie
Parse a cookie value from the request’s Cookie header.
get_credential_account
Fetch the user’s credential account, if present.
get_credential_password_hash
Resolve the user’s stored password hash from the credential account.
get_owned_api_key
Fetch an API key by ID and verify that it belongs to the given user.
issue_user_session
Issue a session for the given user, applying admin-plugin ban semantics when the admin plugin is enabled.
user_has_password
Whether the user currently has a password set.