updates
This commit is contained in:
+1
-15
@@ -26,12 +26,11 @@ const parseCookies = require("../utils/functions/parseCookies");
|
||||
* @param {http.IncomingMessage} params.request - Http request object
|
||||
* @param {string} params.encryptionKey - Encryption Key
|
||||
* @param {string} params.encryptionSalt - Encryption Salt
|
||||
* @param {("deep" | "normal")?} [params.level] - Optional. "Deep" value indicates an extra layer of security
|
||||
* @param {string} params.database - Database Name
|
||||
*
|
||||
* @returns {{ key: string | undefined, csrf: string | undefined }}
|
||||
*/
|
||||
function getToken({ request, encryptionKey, encryptionSalt, level, database }) {
|
||||
function getToken({ request, encryptionKey, encryptionSalt, database }) {
|
||||
try {
|
||||
/**
|
||||
* Grab the payload
|
||||
@@ -81,19 +80,6 @@ function getToken({ request, encryptionKey, encryptionSalt, level, database }) {
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
|
||||
/**
|
||||
* Grab the payload
|
||||
*
|
||||
* @description Grab the payload
|
||||
*/
|
||||
if (level?.match(/deep/i) && !csrf?.match(new RegExp(`${userObject.csrf_k}`))) {
|
||||
return { key: undefined, csrf: undefined };
|
||||
}
|
||||
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
|
||||
/**
|
||||
* Return User Object
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user