summaryrefslogtreecommitdiff
path: root/internal/store
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-20 11:34:33 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-20 11:34:33 -1000
commit08bbcf18b1207153983261652b4a43a9b36f386c (patch)
treee6665608c7c8a87d6c789cf8b4c56d466df6bb8b /internal/store
parent07ba815e8517ee2d3a5fa531361bbd09bdfcbaa7 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/store')
-rw-r--r--internal/store/sqlite.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/store/sqlite.go b/internal/store/sqlite.go
index dac3321..7961f35 100644
--- a/internal/store/sqlite.go
+++ b/internal/store/sqlite.go
@@ -59,6 +59,11 @@ func (s *Store) Close() error {
return s.db.Close()
}
+// DB returns the underlying database connection
+func (s *Store) DB() *sql.DB {
+ return s.db
+}
+
// runMigrations executes all migration files in order
func (s *Store) runMigrations() error {
// Get migration files