From f34d90d147c56ce87bc4773a4a03d006629201ac Mon Sep 17 00:00:00 2001 From: Tben Date: Sat, 12 Aug 2023 05:20:17 +0100 Subject: [PATCH] updates --- package.json | 2 +- users/reauth-user.js | 6 ++++-- users/user-auth.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ee07bb7..29278fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.4.7", + "version": "1.4.8", "description": "Cloud-based SQL data management tool", "main": "index.js", "scripts": { diff --git a/users/reauth-user.js b/users/reauth-user.js index a693a9a..a6541ba 100644 --- a/users/reauth-user.js +++ b/users/reauth-user.js @@ -37,13 +37,14 @@ const userAuth = require("./user-auth"); * @param {String} params.database - Target Database * @param {http.ServerResponse} params.response - Http response object * @param {http.IncomingMessage} params.request - Http request object - * @param {*} params.level - Authentication level + * @param {("deep" | "normal")} [params.level] - Authentication level * @param {String} params.encryptionKey - Encryption Key * @param {String} params.encryptionSalt - Encryption Salt + * @param {string[]} [params.additionalFields] - Additional Fields to be added to the user object * * @returns { Promise } */ -async function reauthUser({ key, database, response, request, level, encryptionKey, encryptionSalt }) { +async function reauthUser({ key, database, response, request, level, encryptionKey, encryptionSalt, additionalFields }) { /** * Check Encryption Keys * @@ -74,6 +75,7 @@ async function reauthUser({ key, database, response, request, level, encryptionK const reqPayload = JSON.stringify({ existingUser: existingUser.payload, database, + additionalFields, }); const httpsRequest = https.request( diff --git a/users/user-auth.js b/users/user-auth.js index a47a557..5a1ebc9 100644 --- a/users/user-auth.js +++ b/users/user-auth.js @@ -33,7 +33,7 @@ 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 {("deep" | "normal")} [params.level] - Optional. "Deep" value indicates an extra layer of security * @param {string} params.database - Database Name * * @returns { AuthenticatedUserObject }