summaryrefslogtreecommitdiff
path: root/pkg/webui/routes.go
diff options
context:
space:
mode:
authorJulien Dessaux2025-02-26 00:07:35 +0100
committerJulien Dessaux2025-02-26 00:07:35 +0100
commit5c6ff8f9018f86917796f5244615b9433b9ecc94 (patch)
tree636c894c12ed7d7278b97488d403e9fcc9be59ae /pkg/webui/routes.go
parent[webui] refactored states and versions routes (diff)
downloadtfstated-5c6ff8f9018f86917796f5244615b9433b9ecc94.tar.gz
tfstated-5c6ff8f9018f86917796f5244615b9433b9ecc94.tar.bz2
tfstated-5c6ff8f9018f86917796f5244615b9433b9ecc94.zip
feat(webui): add user accounts list, admin middleware and admin restricted menu entries
Diffstat (limited to '')
-rw-r--r--pkg/webui/routes.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/webui/routes.go b/pkg/webui/routes.go
index 1fce700..2037df6 100644
--- a/pkg/webui/routes.go
+++ b/pkg/webui/routes.go
@@ -12,6 +12,8 @@ func addRoutes(
) {
requireSession := sessionsMiddleware(db)
requireLogin := loginMiddleware(db, requireSession)
+ requireAdmin := adminMiddleware(db, requireLogin)
+ mux.Handle("GET /accounts", requireAdmin(handleAccountsGET(db)))
mux.Handle("GET /healthz", handleHealthz())
mux.Handle("GET /login", requireSession(handleLoginGET()))
mux.Handle("POST /login", requireSession(handleLoginPOST(db)))