updates
This commit is contained in:
parent
52628e8eee
commit
1c690339d1
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "datasquirel",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -4,13 +4,17 @@
|
||||
* ==============================================================================
|
||||
* @param {Object} response - Http response object
|
||||
*/
|
||||
module.exports = function ({ response }) {
|
||||
module.exports = function ({ request, response }) {
|
||||
/**
|
||||
* Check Encryption Keys
|
||||
*
|
||||
* @description Check Encryption Keys
|
||||
*/
|
||||
response.setHeader("Set-Cookie", ["datasquirelAuthKey=null;samesite=strict;path=/;HttpOnly=true;Secure=true", "csrf=null;samesite=strict;path=/;HttpOnly=true"]);
|
||||
try {
|
||||
const authKeyName = request.cookies.filter((cookie) => cookie.match(/datasquirel_.*_auth_key/))[0];
|
||||
const csrfName = request.cookies.filter((cookie) => cookie.match(/datasquirel_.*_csrf/))[0];
|
||||
|
||||
response.setHeader("Set-Cookie", [`${authKeyName}=null;samesite=strict;path=/;HttpOnly=true;Secure=true`, `${csrfName}=null;samesite=strict;path=/;HttpOnly=true`, `dsqluid=null;samesite=strict;path=/;HttpOnly=true`]);
|
||||
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
@ -20,6 +24,22 @@ module.exports = function ({ response }) {
|
||||
success: true,
|
||||
payload: "User Logged Out",
|
||||
};
|
||||
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
payload: "Logout Failed",
|
||||
};
|
||||
}
|
||||
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
/** ********************************************** */
|
||||
};
|
||||
|
||||
/** ********************************************** */
|
||||
|
Loading…
Reference in New Issue
Block a user