migrate-hustoj: finish

This commit is contained in:
undefined committed 2021-11-13 23:00:32 +08:00
1 parent fe1112e652
commit 803885330d
8 files changed
+232 -50

No files matched your search

+2 -1
View File
@@ -129,7 +129,8 @@ 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) {
const result = h(password, this._salt, this);
if (result !== true && result !== this._hash) {
throw new LoginError(this.uname);
} else if (this.hashType !== 'hydro') {
// eslint-disable-next-line @typescript-eslint/no-use-before-define