fix(auth): handle sign-in attempts from emails with no password (#933)

* fix(auth): dont reject promise when missing password

* fix(auth): use static fallback error message
This commit is contained in:
Jakob Ankarhem
2021-02-15 09:34:40 +01:00
committed by GitHub
parent 8a7fa00164
commit 5e37a96bc0
2 changed files with 6 additions and 3 deletions

View File

@@ -108,11 +108,11 @@ export class User {
}
public passwordMatch(password: string): Promise<boolean> {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
if (this.password) {
resolve(bcrypt.compare(password, this.password));
} else {
return reject(false);
return resolve(false);
}
});
}