This commit is contained in:
Benjamin Toby 2024-12-11 05:24:58 +01:00
parent 64d473e981
commit ad16e42a6c
4 changed files with 11 additions and 11 deletions

View File

@ -103,8 +103,8 @@ module.exports = async function apiLoginUser({
if (isPasswordCorrect && email_login) {
const resetTempCode = await varDatabaseDbHandler({
queryString: `UPDATE users SET ${email_login_field} = ? WHERE email = ? OR username = ?`,
queryValuesArray: ["", email, username],
queryString: `UPDATE users SET ${email_login_field} = '' WHERE email = ? OR username = ?`,
queryValuesArray: [email, username],
database: dbFullName.replace(/[^a-z0-9_]/g, ""),
useLocal,
});

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/datasquirel",
"version": "2.9.5",
"version": "2.9.6",
"description": "Cloud-based SQL data management tool",
"main": "index.js",
"bin": {

8
users/get-user.d.ts vendored
View File

@ -14,18 +14,18 @@ export = getUser;
* @param {object} params - Single Param object containing params
* @param {String} params.key - API Key
* @param {String} params.database - Target Database
* @param {number} params.userId - user id
* @param {number} params.userId - user to get
* @param {string[]} [params.fields] - fields to select
* @param {boolean} [params.user_id] - User ID
* @param {boolean} [params.apiUserId] - API User ID
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
*
* @returns { Promise<import("../package-shared/types").GetUserFunctionReturn>}
*/
declare function getUser({ key, userId, database, fields, user_id, useLocal }: {
declare function getUser({ key, userId, database, fields, apiUserId, useLocal }: {
key: string;
database: string;
userId: number;
fields?: string[];
user_id?: boolean;
apiUserId?: boolean;
useLocal?: boolean;
}): Promise<import("../package-shared/types").GetUserFunctionReturn>;

View File

@ -28,14 +28,14 @@ const apiGetUser = require("../package-shared/functions/api/users/api-get-user")
* @param {object} params - Single Param object containing params
* @param {String} params.key - API Key
* @param {String} params.database - Target Database
* @param {number} params.userId - user id
* @param {number} params.userId - user to get
* @param {string[]} [params.fields] - fields to select
* @param {boolean} [params.user_id] - User ID
* @param {boolean} [params.apiUserId] - API User ID
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
*
* @returns { Promise<import("../package-shared/types").GetUserFunctionReturn>}
*/
async function getUser({ key, userId, database, fields, user_id, useLocal }) {
async function getUser({ key, userId, database, fields, apiUserId, useLocal }) {
/**
* Initialize
*/
@ -122,7 +122,7 @@ async function getUser({ key, userId, database, fields, user_id, useLocal }) {
port,
hostname: host,
path: `/api/user/${
user_id || grabedHostNames.user_id
apiUserId || grabedHostNames.user_id
}/get-user`,
},