Skip to content

Commit

Permalink
otherwise password is always valid
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsanos authored Sep 30, 2017
1 parent f5af49c commit c5b984e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ userSchema.statics = {
isPublic: true,
};
if (password) {
if (user && user.passwordMatches(password)) {
if (user && await user.passwordMatches(password)) {
return { user, accessToken: user.token() };
}
err.message = 'Incorrect email or password';
Expand Down

0 comments on commit c5b984e

Please sign in to comment.