From 588efcad3dba8e1ee49b90aeb6757da6772ddc35 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sun, 10 Sep 2023 21:35:18 +0100 Subject: [PATCH] Random notes Signed-off-by: Fred Boniface --- src/utils/auth.utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/auth.utils.ts b/src/utils/auth.utils.ts index de63874..a75e12a 100644 --- a/src/utils/auth.utils.ts +++ b/src/utils/auth.utils.ts @@ -22,10 +22,11 @@ async function isAuthed(uuid: string): Promise { } // Checks whether a registration request key is valid -async function checkRequest(key: string) { +async function checkRequest(key: string) { // For some reason db.query seems to return correctly, but the second logs.out statement prints []??? so registration fails!! const collection = "registrations"; const query = { uuid: key }; const res = await db.query(collection, query); + logs.out("authUtils.checkRequest: Raw Result: " + res, "dbug") logs.out( "authUtils.checkRequest: DB Query result: " + JSON.stringify(res), "dbug" @@ -39,7 +40,7 @@ async function checkRequest(key: string) { // Creates an API key for a user async function generateKey() { - // Needs testing & moving to 'register.utils' + // Needs testing & moving to 'register.utils' ??? Why does it need moving? return crypt.randomUUID(); }