Merge pull request #11078 from ChesterSng/11602-display-message-when-social-auth-acc-uses-password

Fixes #11062 Display information message when social authentication account uses password to login
This commit is contained in:
Matteo Pagliazzi
2019-03-23 18:36:12 +01:00
committed by GitHub
5 changed files with 47 additions and 1 deletions

View File

@@ -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) {