Skip to content

Commit

Permalink
Remove unnecessary return.
Browse files Browse the repository at this point in the history
  • Loading branch information
elszczepano committed Dec 23, 2018
1 parent 4aec577 commit 9600a2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middlewares/loginCheck.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import passport from 'passport';

export default (req, res, next) => {
return passport.authenticate('local',{session: false}, (err, user, info) => {
passport.authenticate('local',{session: false}, (err, user, info) => {
if (err) return next(err);
if (!user) {
return res.status(401).json({
success: false,
error: info.message || 'An error occurred.'
})
});
}
req.user = user;
next();
Expand Down

0 comments on commit 9600a2d

Please sign in to comment.