E
E
enhaster2016-09-06 15:10:56
JavaScript
enhaster, 2016-09-06 15:10:56

Saving login/password in browser after redirect in expressjs?

Tell me how to activate the window for saving the login / password in the browser, if after this login I have a redirect.

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');
  });
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question