apunteak/ariketa-03/routes/api.js
2022-01-29 20:56:40 +01:00

12 lines
322 B
JavaScript

/* POST eskaera */
exports.login = function(req, res){
//console.log(req.body);
var logged;
if(req.body.username != ''){
res.cookie('username', req.body.username, { expires: new Date(Date.now() + 900000), 'sameSite':'lax'});
logged = true;
}
res.render('index',{logged: logged, username: req.body.username});
};