Skip to content

Commit a36830b

Browse files
authored
Merge pull request #3032 from lindapaiste/refactor/user.controller
Convert `user.controller.js` to `async`/`await` syntax.
2 parents 64525fc + 1be928c commit a36830b

File tree

3 files changed

+240
-302
lines changed

3 files changed

+240
-302
lines changed

server/config/passport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ passport.use(
4545
done(null, false, { msg: accountSuspensionMessage });
4646
return;
4747
}
48-
user.comparePassword(password, (innerErr, isMatch) => {
48+
user.comparePassword(password).then((isMatch) => {
4949
if (isMatch) {
5050
done(null, user);
51-
return;
51+
} else {
52+
done(null, false, { msg: 'Invalid email or password.' });
5253
}
53-
done(null, false, { msg: 'Invalid email or password.' });
5454
});
5555
})
5656
.catch((err) => done(null, false, { msg: err }));

0 commit comments

Comments
 (0)