From 08bbcf18b1207153983261652b4a43a9b36f386c Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 20 Jan 2026 11:34:33 -1000 Subject: Add session-based authentication Implement secure authentication using scs session manager with SQLite backing store and bcrypt password hashing. - Add users and sessions tables (migration 004) - Create internal/auth package with Service, Middleware, and Handlers - Protect all routes except /login, /logout, /static/* - Add login page template and logout button to dashboard - Default credentials: admin/changeme (configurable via env vars) Co-Authored-By: Claude Opus 4.5 --- web/templates/index.html | 6 +++++ web/templates/login.html | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 web/templates/login.html (limited to 'web') diff --git a/web/templates/index.html b/web/templates/index.html index b341c17..54bb0c6 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -19,6 +19,12 @@ class="bg-primary-600 hover:bg-primary-700 text-white px-4 py-2 rounded-lg transition-colors font-medium no-print"> Refresh +
+ +
diff --git a/web/templates/login.html b/web/templates/login.html new file mode 100644 index 0000000..e5ce9e4 --- /dev/null +++ b/web/templates/login.html @@ -0,0 +1,57 @@ + + + + + + Login - Personal Dashboard + + + +
+
+

Personal Dashboard

+ + {{if .Error}} +
+ {{.Error}} +
+ {{end}} + +
+
+ + +
+ +
+ + +
+ + +
+
+
+ + -- cgit v1.2.3