From 285c82193f9a583195b20bbcc460d7b3798cf69e Mon Sep 17 00:00:00 2001 From: Tben <52448020+BenjaminToby@users.noreply.github.com> Date: Tue, 23 May 2023 15:25:55 +0100 Subject: [PATCH] updates --- package.json | 2 +- users/reauth-user.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0b4c64c..4dcc8b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.1.29", + "version": "1.1.30", "description": "Cloud-based SQL data management tool", "main": "index.js", "scripts": { diff --git a/users/reauth-user.js b/users/reauth-user.js index b72ac7e..c7c6ba6 100644 --- a/users/reauth-user.js +++ b/users/reauth-user.js @@ -71,6 +71,14 @@ module.exports = async function ({ key, database, response, request, level, encr request, }); + if (!existingUser?.payload?.id) { + return { + success: false, + payload: null, + msg: "Cookie Credentials Invalid", + }; + } + /** * Make https request * @@ -78,7 +86,7 @@ module.exports = async function ({ key, database, response, request, level, encr */ const httpResponse = await new Promise((resolve, reject) => { const reqPayload = JSON.stringify({ - existingUser, + existingUser: existingUser.payload, database, });