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
Post a Comment