diff --git a/engine/user/login-user.js b/engine/user/login-user.js index 2585505..1a6ac92 100644 --- a/engine/user/login-user.js +++ b/engine/user/login-user.js @@ -5,7 +5,7 @@ const varDatabaseDbHandler = require("../engine/utils/varDatabaseDbHandler"); /** * - * @param {PackageUserLoginLocalBody} param0 + * @param {import("../../package-shared/types").PackageUserLoginLocalBody} param0 * @returns */ async function loginLocalUser({ diff --git a/engine/user/send-email-code.js b/engine/user/send-email-code.js index a613f2d..a53abd9 100644 --- a/engine/user/send-email-code.js +++ b/engine/user/send-email-code.js @@ -77,15 +77,6 @@ async function localSendEmailCode({ msg: "No user found", }; - function generateCode() { - const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - let code = ""; - for (let i = 0; i < 8; i++) { - code += chars[Math.floor(Math.random() * chars.length)]; - } - return code; - } - if (foundUser && foundUser[0] && email_login_field) { const tempCode = generateCode(); @@ -150,4 +141,13 @@ async function localSendEmailCode({ } } +function generateCode() { + const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + let code = ""; + for (let i = 0; i < 8; i++) { + code += chars[Math.floor(Math.random() * chars.length)]; + } + return code; +} + module.exports = localSendEmailCode; diff --git a/package.json b/package.json index 84c485a..0abd005 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "2.2.3", + "version": "2.2.6", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {