Merge pull request #2 from williansmartins/patch-1

Update users.js
master
Mahesh Bhanushali 7 years ago committed by GitHub
commit 2a1149255b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,7 +20,7 @@ module.exports = {
next(err);
} else {
if(bcrypt.compareSync(req.body.password, userInfo.password)) {
if(userInfo != null && bcrypt.compareSync(req.body.password, userInfo.password)) {
const token = jwt.sign({id: userInfo._id}, req.app.get('secretKey'), { expiresIn: '1h' });

Loading…
Cancel
Save