datasquirel/users/get-token.d.ts

34 lines
1.5 KiB
TypeScript
Raw Normal View History

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
* @param {http.IncomingMessage} params.request - Http request object
* @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-06 11:55:03 +00:00
declare function getToken({ request, encryptionKey, encryptionSalt, database, useLocal, }: {
2024-11-08 15:44:31 +00:00
request: http.IncomingMessage;
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");