single-user login screen
- server/credentials.py: PBKDF2 password + session secret, 0600 json, one-time setup command (server refuses to start without it) - app.py: signed 30-day cookie (itsdangerous), middleware 401s API / redirects pages to /login?next=, 5-fail/15-min lockout, /logout - static/login.html: dark-themed form, inline error display - app.js: api() 401 -> redirect to /login preserving current URL - docs: README quick start + features, SPEC auth section
This commit is contained in:
1 parent
2c203990bc
commit
76c45a8f29
7 files changed
+181
-6
No files matched your search
@@ -4,6 +4,10 @@ let hls = null, detail = null, lang = "eng", seasonId = null;
|
||||
|
||||
async function api(path) {
|
||||
const r = await fetch(path);
|
||||
if (r.status === 401) {
|
||||
location.href = "/login?next=" + encodeURIComponent(location.pathname + location.search);
|
||||
throw new Error("not authenticated");
|
||||
}
|
||||
if (!r.ok) {
|
||||
let msg = r.statusText;
|
||||
try { msg = (await r.json()).detail || msg; } catch {}
|
||||
|
||||
Reference in new issue
Block a user