From b5cd6f16c939104c9b0659ca75d65aa1785a9832 Mon Sep 17 00:00:00 2001 From: Richter Date: Sun, 10 Mar 2019 09:35:43 +0100 Subject: [PATCH] Update routing.js --- server/routing.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/routing.js b/server/routing.js index a978702..7b6e82d 100644 --- a/server/routing.js +++ b/server/routing.js @@ -147,12 +147,18 @@ module.exports = function(app, sql, app_cfg, passport, auth) { app.post('/login', passport.authenticate('local', { failureRedirect: '/login' }), function(req, res) { + if(req.body.rememberme){ + // der Benutzer muss sich fuer 5 Jahre nicht anmelden + req.session.cookie.maxAge = 5 * 365 * 24 * 60 * 60 * 1000; + }; res.redirect('/'); }); app.post('/login_ip', passport.authenticate('ip', { failureRedirect: '/login' }), function(req, res) { + // der Benutzer muss sich fuer 5 Jahre nicht anmelden + req.session.cookie.maxAge = 5 * 365 * 24 * 60 * 60 * 1000; res.redirect('/'); });