diff --git a/src/inc/routes/admin.mjs b/src/inc/routes/admin.mjs index 68f1178..cf8545b 100644 --- a/src/inc/routes/admin.mjs +++ b/src/inc/routes/admin.mjs @@ -38,8 +38,14 @@ export default (router, tpl) => { browser: req.headers["user-agent"], created_at: stamp, last_used: stamp, - last_action: "/login" + last_action: "/login", + kmsi: req.post.kmsi === 'on' ? 1 : 0 }); + + await sql("user_sessions") // delete unused sessions + .where('last_action', '<=', (Date.now() - 6048e5)) + .andWhere('kmsi', 0) + .del(); return res.writeHead(301, { "Cache-Control": "no-cache, public", diff --git a/views/login.html b/views/login.html index 4dcaa88..5cda379 100644 --- a/views/login.html +++ b/views/login.html @@ -11,6 +11,7 @@
+