1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-09-18 21:28:47 +00:00

Start delete group method

This commit is contained in:
2019-12-27 18:49:40 +01:00
parent 2222873d69
commit 820b861ef8
4 changed files with 49 additions and 0 deletions

@@ -121,6 +121,26 @@ export class AccountHelper {
});
}
/**
* Check out whether the password of a user is valid
* or not
*
* @param userID Target user ID
* @param password Target password
*/
public static async CheckUserPassword(userID: number, password: string) : Promise<boolean> {
const crypt_pass = this.CryptPassword(password);
return await DatabaseHelper.Count({
table: USER_TABLE,
where: {
ID: userID,
password: crypt_pass
}
}) > 0;
}
/**
* Crypt a password
*