mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-23 06:07:07 +00:00
Add check for the existence of user's password before attempting to authenticate
This commit is contained in:
parent
23cc2b9d21
commit
3e45f5af41
1 changed files with 3 additions and 0 deletions
|
|
@ -98,6 +98,9 @@ api.loginLocal = {
|
|||
// load the entire user because we may have to save it to convert the password to bcrypt
|
||||
let user = await User.findOne(login).exec();
|
||||
|
||||
// if user is using social login, then user will not have a hashed_password stored
|
||||
if (!user.auth.local.hashed_password) throw new NotAuthorized(res.t('invalidLoginCredentialsLong'));
|
||||
|
||||
let isValidPassword;
|
||||
|
||||
if (!user) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue