Answers for "CONCEITO DO JWT"

0

CONCEITO DO JWT

apiRoutes.post('/', function (req, res) {
if (req.body.UserName != "tadriano" || req.body.PassWord != "102030") {
 res.json({ success: false, message: 'Usuário ou senha incorreto(s)!' });
} else {
let usuario = new user()
 { 
 name : "tadriano";
 admin: true
 };
var token = jwt.sign(usuario, 'batman batman batman', {
 expiresInMinutes: 1440
 });
 
 res.json({
 success: true,
 message: 'Token criado!!!',
 toke: token
 });
 }
});
Posted by: Guest on November-25-2020

Code answers related to "BASIC"

Browse Popular Code Answers by Language