tiny-essentials
Version:
Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.
23 lines • 1.03 kB
text/typescript
/**
* Handles the logout process for the user by revoking the token and redirecting.
*
* @param {Record<string, any>} req - The HTTP request object.
* @param {string|number} access_token - The access token of the user to be revoked.
* @param {Record<string, any>} cfg - Configuration object containing settings for the logout process.
* @param {boolean} existSession - A flag indicating whether a session exists.
*
* @returns {Promise<Record<string, any>>} Resolves with a result object or rejects with an error.
*
* @throws {Record<string, any>} Rejects with an error if configuration or token values are invalid.
*
* @example
* logout(req, 'userAccessToken', cfg, true)
* .then(result => {
* // Handle successful logout
* })
* .catch(err => {
* // Handle error during logout
* });
*/
export default function logout(req: Record<string, any>, access_token: string | number, cfg: Record<string, any>, existSession: boolean): Promise<Record<string, any>>;
//# sourceMappingURL=logout.d.mts.map