summaryrefslogtreecommitdiff
path: root/pkg/webui/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/webui/routes.go')
-rw-r--r--pkg/webui/routes.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/webui/routes.go b/pkg/webui/routes.go
index 6ebe90b..e9a0346 100644
--- a/pkg/webui/routes.go
+++ b/pkg/webui/routes.go
@@ -10,12 +10,12 @@ func addRoutes(
mux *http.ServeMux,
db *database.DB,
) {
- session := sessionsMiddleware(db)
- requireLogin := loginMiddleware(db)
+ requireSession := sessionsMiddleware(db)
+ requireLogin := loginMiddleware(db, requireSession)
mux.Handle("GET /healthz", handleHealthz())
- mux.Handle("GET /login", session(handleLoginGET()))
- mux.Handle("POST /login", session(handleLoginPOST(db)))
- mux.Handle("GET /logout", session(requireLogin(handleLogoutGET(db))))
+ mux.Handle("GET /login", requireSession(handleLoginGET()))
+ mux.Handle("POST /login", requireSession(handleLoginPOST(db)))
+ mux.Handle("GET /logout", requireLogin(handleLogoutGET(db)))
mux.Handle("GET /static/", cache(http.FileServer(http.FS(staticFS))))
- mux.Handle("GET /", session(requireLogin(handleIndexGET())))
+ mux.Handle("GET /", requireLogin(handleIndexGET()))
}