javascript - jwt.sign added parameter to token error -


i added user id login token user gets when logs in access in index.html. i've done program unable find user edit in database. "user not exist" message. reason user cannot found in database don't know how fix this.

if (!user) { res.json({ success: false, message: 'username not found' }); 

i added _id token , .select:

user.findone({ username: req.body.username }).select('username active email _id resettoken name').exec(function(err, user) 

wt.sign({ username: user.username, email: user.email, id: user._id } 

could please me?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -