Functions for authenticating users with JWT cookies, controlling access to API endpoints, and managing sessions.
The writeJwt function generates a signed JWT (JSON Web Token) and writes it as a session cookie (access_token) to the user's browser.…
access_token
The deleteJwt function is responsible for removing the current (if any) JWT (JSON Web Token) secure cookie from the user's browser.
Sets the response of the current API request to HTTP 401 Login Required. It does NOT stop your code: the function returns, and everything…
Ends the built-in Docly session for the calling user and clears the session cookie. Typically invoked from an API endpoint (e.g.…
flagActivity flags suspicious request patterns to deter potential brute force attacks. After a set number of flagged requests from a single…
Returns the URL of a user's profile picture (a 164 × 164 thumbnail), for use in an img tag.