updates
This commit is contained in:
parent
224dbf4175
commit
7e83ab8d0e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "datasquirel",
|
"name": "datasquirel",
|
||||||
"version": "1.0.6",
|
"version": "1.0.8",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -131,7 +131,7 @@ module.exports = async function ({ key, payload, database, response, encryptionK
|
|||||||
encryptionSalt,
|
encryptionSalt,
|
||||||
});
|
});
|
||||||
|
|
||||||
response.setHeader("Set-Cookie", [`datasquirelAuthKey=${encryptedPayload};samesite=strict;path=/;HttpOnly=true;Secure=true`, `csrf=${httpResponse.csrf};samesite=strict;path=/;HttpOnly=true`]);
|
response.setHeader("Set-Cookie", [`datasquirelAuthKey=${encryptedPayload};samesite=strict;path=/;HttpOnly=true;Secure=true`, `csrf=${httpResponse.payload.csrf};samesite=strict;path=/;HttpOnly=true`]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ********************************************** */
|
/** ********************************************** */
|
||||||
|
@ -21,6 +21,7 @@ const decrypt = require("../functions/decrypt");
|
|||||||
* @param {String} encryptionSalt - Encryption Salt
|
* @param {String} encryptionSalt - Encryption Salt
|
||||||
*/
|
*/
|
||||||
module.exports = function ({ request, encryptionKey, encryptionSalt }) {
|
module.exports = function ({ request, encryptionKey, encryptionSalt }) {
|
||||||
|
try {
|
||||||
/**
|
/**
|
||||||
* Grab the payload
|
* Grab the payload
|
||||||
*
|
*
|
||||||
@ -90,6 +91,18 @@ module.exports = function ({ request, encryptionKey, encryptionSalt }) {
|
|||||||
success: true,
|
success: true,
|
||||||
payload: userObject,
|
payload: userObject,
|
||||||
};
|
};
|
||||||
|
} catch (error) {
|
||||||
|
/**
|
||||||
|
* Return User Object
|
||||||
|
*
|
||||||
|
* @description Return User Object
|
||||||
|
*/
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
payload: null,
|
||||||
|
msg: error.message,
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ********************************************** */
|
/** ********************************************** */
|
||||||
|
Loading…
Reference in New Issue
Block a user