Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ passport.use(
done(null, false, { msg: accountSuspensionMessage });
return;
}
user.comparePassword(password, (innerErr, isMatch) => {
user.comparePassword(password).then((isMatch) => {
Copy link
Contributor

@swrno swrno Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use async await syntax here also.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure. I figured I’d convert the passport file in a separate PR. So I made the minimum change to keep it working for now.

if (isMatch) {
done(null, user);
return;
} else {
done(null, false, { msg: 'Invalid email or password.' });
}
done(null, false, { msg: 'Invalid email or password.' });
});
})
.catch((err) => done(null, false, { msg: err }));
Expand Down
Loading