A promise that resolves to an object containing a boolean indicating whether the token is valid and the user ID if validation succeeds; otherwise, null is returned for the user ID.
Validates the bearer token present in the provided request.
The HTTP request containing the Authorization header.
A promise that resolves to the decoded JWT payload if the token is valid, or a numeric status code (e.g., 401) if validation fails.
Generates a token for the specified user.
The unique identifier of the user.
The display name of the user.
Indicates whether a refresh token should be issued.
Optionaljti: string
Optional JWT ID to correlate tokens.
A promise that resolves with the generated token and, if requested, a refresh token.
Decodes a JWT access token and returns its payload.
The JWT access token to decode.
The decoded payload if the token is valid, otherwise null.
Generates a signed JWT access token.
The payload data for the token.
Optionalexpire: number | "default" | "refresh" | StringValue
Optional expiration time for the token, expressed in seconds or as an ISO 8601 duration string.
A promise that resolves to the generated JWT token string.
Verifies a JWT access token and returns the decoded payload or an error code.
The JWT access token string to verify.
A promise that resolves to the decoded token payload of type
Validates user permissions according to the supplied validation request.
The request object containing the necessary data for permission evaluation, such as user identity, requested action, and contextual parameters.
A promise that resolves to true if the permissions
are valid for the specified request, otherwise resolves to false.
Sets an authentication cookie on the given response using the provided token data.
A promise that resolves when the cookie has been set successfully.
Extracts an authentication token from the provided request.
The incoming request object from which to extract the token.
The extracted token if present; otherwise, undefined.
Validates an API token for a specified user and request type.