重定向后,Expressjs密码保存在chrome中

时间:2016-09-06 09:13:23

标签: javascript session express login authorization

请帮助我理解如何在Chrome(和其他浏览器)中添加保存密码窗口,如果我在重新登录后重定向用户?

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.email = rows[0].email;
      req.session.password = rows[0].password;
      req.session.nickname = rows[0].nickname;
    }
    res.redirect('back');
  });
});

登录后显示

没有重定向窗口:(

0 个答案:

没有答案