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; } }