Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonPatmore committed Mar 20, 2018
1 parent f347e96 commit ce2ff30
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Server Backend/routes/users-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ router.post('/createUser', function(req, res, next) {
res.json({ username: newUser.username, team: newUser.team })
return
}
}
if (!newUser) {
res.status(500).json(
{code: 'U2', title: 'User error', desc: 'There was a problem registering the user.'})
return
}
// create a token
var token = jwt.sign({ username: newUser.username }, config.secret, {
expiresIn: '1 year' // expires in 1 year
error = 0
/**
* Returns to the user a JSON object containing the new user
*/
res.json(response)
}).catch(e => {
console.log(e)
})
})

Expand Down

0 comments on commit ce2ff30

Please sign in to comment.