From 5eef6628a43cdf183d953ca83ab29bbe74e328f7 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Tue, 10 Dec 2024 15:31:53 +0100 Subject: [PATCH] Updates --- package.json | 2 +- users/validate-temp-email-code.d.ts | 4 ++-- users/validate-temp-email-code.js | 11 +++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index bea5bdf..4352676 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "2.8.5", + "version": "2.8.6", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": { diff --git a/users/validate-temp-email-code.d.ts b/users/validate-temp-email-code.d.ts index ddb930b..0d1e334 100644 --- a/users/validate-temp-email-code.d.ts +++ b/users/validate-temp-email-code.d.ts @@ -8,12 +8,12 @@ export = validateTempEmailCode; * @param {http.IncomingMessage & Object} params.request * @param {string} [params.email] * - * @returns { Promise} + * @returns { Promise} */ declare function validateTempEmailCode({ request, email }: { request: http.IncomingMessage & { [x: string]: any; }; email?: string; -}): Promise; +}): Promise; import http = require("http"); diff --git a/users/validate-temp-email-code.js b/users/validate-temp-email-code.js index c4f4782..0176648 100644 --- a/users/validate-temp-email-code.js +++ b/users/validate-temp-email-code.js @@ -15,7 +15,7 @@ const EJSON = require("../package-shared/utils/ejson"); * @param {http.IncomingMessage & Object} params.request * @param {string} [params.email] * - * @returns { Promise} + * @returns { Promise} */ async function validateTempEmailCode({ request, email }) { try { @@ -35,18 +35,17 @@ async function validateTempEmailCode({ request, email }) { ); if (payload?.email && !email) { - return true; + return payload; } if (payload?.email && payload.email === email) { - return true; + return payload; } - return false; + return null; } catch (/** @type {any} */ error) { console.log("validateTempEmailCode error:", error.message); - - return false; + return null; } }