Expressjs password saving in chrome after redirect

29 views
Skip to first unread message

Max

unread,
Sep 6, 2016, 8:04:15 AM9/6/16
to Express
Help me please to understand, how to add save password window in chrome(and other browsers), if i redirect user back after successful login?


app.put('/login', function(req, res, next) {
  pool
.query(
'SELECT idperson, nickname, email, password FROM person WHERE email=? AND password=?', [req.body.email, req.body.password], function(err, rows, fields, next) {
   
if (err) return next(err);
   
if (!rows[0]) console.log('Неверные данные');
   
else {
      req
.session.idperson = rows[
0].idperson;
      req
.session.nickname = rows[
0].nickname;
   
}
    res
.redirect(
'back');
 
});
});



Reply all
Reply to author
Forward
0 new messages