aboutsummaryrefslogtreecommitdiff
path: root/cmd/server
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-09-12 18:37:30 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-09-12 18:40:00 +0200
commitae10e121875982d6956d6bff453544cc59a75616 (patch)
tree9b6508c9b2a105ce3027bb24342916050e2f50cc /cmd/server
parentd33ba9ee675eedf47ce4a7977d116bf81dda5b2e (diff)
downloadlens-ae10e121875982d6956d6bff453544cc59a75616.tar.gz
lens-ae10e121875982d6956d6bff453544cc59a75616.tar.bz2
lens-ae10e121875982d6956d6bff453544cc59a75616.zip
feat: Add admin control
Now only admins can access settings.
Diffstat (limited to 'cmd/server')
-rw-r--r--cmd/server/main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index 58256fa..41b2b4a 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -72,7 +72,7 @@ func main() {
panic("failed to decode key database: " + err.Error())
}
- r := mux.NewRouter()
+ r := mux.NewRouter().StrictSlash(false)
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static.Static))))
// repository
@@ -85,7 +85,7 @@ func main() {
// middleware
var (
- authMiddleware = ext.NewAuthMiddleware(baseKey, logger.WithField("context", "auth"))
+ authMiddleware = ext.NewAuthMiddleware(baseKey, logger.WithField("context", "auth"), userRepository)
logMiddleware = ext.NewLogMiddleare(logger.WithField("context", "http"))
initialMiddleware = ext.NewInitialSetupMiddleware(userRepository)
)