feat: add 'Keep me logged in' checkbox to login form
Some checks failed
Build and Push Docker Image / build (push) Successful in 26s
CI / npm audit (push) Has been cancelled

- index.html: checkbox between password field and login button
- app.js: reads #remember-me and passes rememberMe in POST body
- auth.js: rememberMe=true sets 30-day maxAge; false = session cookie
  (expires when browser closes)
- style.css: .form-group--checkbox and .checkbox-label styles
This commit is contained in:
2026-05-16 17:15:28 +01:00
parent 031877e6a0
commit e83afde5ef
4 changed files with 44 additions and 6 deletions

View File

@@ -136,6 +136,7 @@ async function handleLogin(e) {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const rememberMe = document.getElementById('remember-me').checked;
try {
const response = await fetch('/api/auth/login', {
@@ -143,7 +144,7 @@ async function handleLogin(e) {
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ username, password })
body: JSON.stringify({ username, password, rememberMe })
});
const data = await response.json();