fix problems found by deepscan.io

This commit is contained in:
undefined committed 2020-11-08 23:44:16 +08:00
1 parent e8dcd97561
commit dd4ecdb029
13 files changed
+33 -29

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ export class User implements _User {
checkPassword(password: string) {
const h = global.Hydro.lib[`hash.${this.hashType}`];
if (!h) throw new Error('Unknown hash method');
if (!(h(password, this.salt(), this) === this.hash())) {
if (h(password, this.salt(), this) !== this.hash()) {
throw new LoginError(this.uname);
} else if (this.hashType !== 'hydro') {
setPassword(this._id, password);