2024-11-08 15:44:31 +00:00
|
|
|
export = getToken;
|
|
|
|
/** ****************************************************************************** */
|
|
|
|
/** ****************************************************************************** */
|
|
|
|
/** ****************************************************************************** */
|
|
|
|
/** ****************************************************************************** */
|
|
|
|
/** ****************************************************************************** */
|
|
|
|
/** ****************************************************************************** */
|
|
|
|
/**
|
|
|
|
* Get just the access token for user
|
|
|
|
* ==============================================================================
|
|
|
|
* @description This Function takes in a request object and returns a user token
|
|
|
|
* string and csrf token string
|
|
|
|
*
|
|
|
|
* @param {Object} params - Arg
|
2024-12-13 13:08:41 +00:00
|
|
|
* @param {http.IncomingMessage} [params.request] - Http request object
|
|
|
|
* @param {string} [params.cookieString]
|
2024-11-08 15:44:31 +00:00
|
|
|
* @param {string} params.encryptionKey - Encryption Key
|
|
|
|
* @param {string} params.encryptionSalt - Encryption Salt
|
|
|
|
* @param {string} params.database - Database Name
|
2024-12-06 11:55:03 +00:00
|
|
|
* @param {boolean} [params.useLocal]
|
2024-11-08 15:44:31 +00:00
|
|
|
*
|
|
|
|
* @returns {{ key: string | undefined, csrf: string | undefined }}
|
|
|
|
*/
|
2024-12-13 13:08:41 +00:00
|
|
|
declare function getToken({ request, encryptionKey, encryptionSalt, database, useLocal, cookieString, }: {
|
|
|
|
request?: http.IncomingMessage;
|
|
|
|
cookieString?: string;
|
2024-11-08 15:44:31 +00:00
|
|
|
encryptionKey: string;
|
|
|
|
encryptionSalt: string;
|
|
|
|
database: string;
|
2024-12-06 11:55:03 +00:00
|
|
|
useLocal?: boolean;
|
2024-11-08 15:44:31 +00:00
|
|
|
}): {
|
|
|
|
key: string | undefined;
|
|
|
|
csrf: string | undefined;
|
|
|
|
};
|
|
|
|
import http = require("http");
|