Skip to content

Commit 034c520

Browse files
committed
Convert user.controller.js to async/await syntax.
1 parent 755897e commit 034c520

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)