Authentication
Functions for authenticating users with JWT cookies, controlling access to API endpoints, and managing sessions.
writeJwt(userinfo)
The writeJwt function is responsible for generating and writing a JWT (JSON Web Token) secure cookie to the user's browser.
See also: deleteJwt, denyAccess, logOut, flagActivity, getProfilePictureUrl — and Custom JWT login example.
denyAccess
This function exits and returns a login required error.
See also: writeJwt, deleteJwt, logOut, flagActivity, getProfilePictureUrl — and Custom JWT login example.
flagActivity
flagActivity flags suspicious request patterns to deter potential brute force attacks. After a set number of flagged requests from a single IP, it blocks that IP to protect the platform.
See also: writeJwt, deleteJwt, denyAccess, logOut, getProfilePictureUrl — and Custom JWT login example.
deleteJwt
The deleteJwt function is responsible for removing the current (if any) JWT (JSON Web Token) secure cookie from the user's browser.
See also: writeJwt, denyAccess, logOut, flagActivity, getProfilePictureUrl — and Custom JWT login example.
getProfilePictureUrl(user)
This function retrieves the URL of a user's profile picture from the system. It returns a string containing the direct link to the image, which can be used to display the user's profile picture in applications or web interfaces.
See also: writeJwt, deleteJwt, denyAccess, logOut, flagActivity — and Custom JWT login example.
logOut
Logs current user out from docly session via API.
See also: writeJwt, deleteJwt, denyAccess, flagActivity, getProfilePictureUrl — and Custom JWT login example.