I want pass the encrypted password into the object. So when API called password will be in the encrypted form.
app.post('/api/login', (req, res) => {
const user = {
id: 1,
username: "Vinit",
password: "12345" //Here I want to pass the encrypted password
}
jwt.sign({user: user}, 'secretkey', (err, token) => {
res.json({
token: token
});
});
});
req.body.password?