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