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.
IssuedSessionRecord
Actual session issuance with retained adapter output for framework callbacks and separately filtered public responses.
SessionOverrides
Trusted fields for the initial session insert in a custom sign-in flow.

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.
issue_user_session_record
Issue and publish genuine retained adapter results.
issue_user_session_with_fields
Issue a session with trusted fields applied during its initial insert.
issue_user_session_with_fields_record
Issue a session with trusted initial fields and retain its adapter output.
issue_user_session_with_overrides
Issue a replacement session while preserving trusted session extension fields.
issue_user_session_with_overrides_record
Issue replacement records with actual retained output.
require_org_api_key_permission
Authorize a user against an organization-owned API key, mirroring upstream’s checkOrgApiKeyPermission.
response_session
Resolve the session selected by a completed response’s signed session cookie.
user_has_password
Whether the user currently has a password set.