mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Fix 500 server error when trying to log in with wrong username (#11126)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
e4eca4b767
commit
821fc1d9c0
@@ -99,7 +99,7 @@ api.loginLocal = {
|
||||
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'));
|
||||
if (!user || !user.auth.local.hashed_password) throw new NotAuthorized(res.t('invalidLoginCredentialsLong'));
|
||||
|
||||
let isValidPassword;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user