diff --git a/users/login-user.js b/users/login-user.js index a7ee641..63f753b 100644 --- a/users/login-user.js +++ b/users/login-user.js @@ -47,6 +47,7 @@ const loginLocalUser = require("../engine/user/login-user"); * @param {boolean} [params.email_login] - Email only Login * @param {string} [params.email_login_code] - Email login code * @param {string} [params.temp_code_field] - Database table field name for temporary code + * @param {boolean} [params.token] - Send access key as part of response body? * * @returns { Promise} */ @@ -61,6 +62,7 @@ async function loginUser({ email_login, email_login_code, temp_code_field, + token, }) { const scheme = process.env.DSQL_HTTP_SCHEME; const localHost = process.env.DSQL_LOCAL_HOST; @@ -229,6 +231,10 @@ async function loginUser({ encryptionSalt, }); + try { + if (token) httpResponse["token"] = encryptedPayload; + } catch (error) {} + const { userId } = httpResponse; const authKeyName = `datasquirel_${userId}_${database}_auth_key`;