From 48a9eeb83994c0f17192877844acd61466fe6755 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Tue, 21 Jul 2026 14:28:29 +0200 Subject: [PATCH] Gate the admin panel behind a real login screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /admin now shows only a token field + "Accedi" button on first load — config and users are structurally in the page but empty/hidden, no data requested until the token is verified. On successful login (a GET /admin/config that doesn't 403) it reveals the dashboard and loads config + users automatically; no more separate "Carica configurazione"/ "Carica utenti" buttons. Token is kept in sessionStorage (cleared on tab close) so a reload during the same session skips straight back to the dashboard. Added a Logout button and Enter-to-submit on the token field. Co-Authored-By: Claude Sonnet 5 --- app/static/admin.html | 170 ++++++++++++++++++++++++++---------------- 1 file changed, 106 insertions(+), 64 deletions(-) diff --git a/app/static/admin.html b/app/static/admin.html index 992a223..5041033 100644 --- a/app/static/admin.html +++ b/app/static/admin.html @@ -124,55 +124,65 @@ -
-

PLM Lottery — Admin

-

Configurazione operativa del round

-
+
+
+

PLM Lottery — Admin

+

Accesso riservato

+
-
-

- Salvata nel database, modificabile in qualsiasi momento senza riavviare il server. - Serve il token admin (ADMIN_TOKEN nel .env del server). -

+
+ + + +
+
- - +