Skip to content

Submitting authentication#29

Open
drewferris wants to merge 67 commits into
sea-401d5-javascript:masterfrom
drewferris:submitting-authentication
Open

Submitting authentication#29
drewferris wants to merge 67 commits into
sea-401d5-javascript:masterfrom
drewferris:submitting-authentication

Conversation

@drewferris
Copy link
Copy Markdown

ready to submit

Comment thread routes/auth_routes.js
router.get('/login', basicHTTP, (req, res, next) => {
User.findOne({username: req.auth.username}, (err, user) => {
if(err || !user) return next(new Error('Could not login'));
if (!user.comparePassword(req.auth.password)) return next('Could not sign in');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should return next with new Error here like you did on line 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants