From ae10e121875982d6956d6bff453544cc59a75616 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Tue, 12 Sep 2023 18:37:30 +0200 Subject: feat: Add admin control Now only admins can access settings. --- cmd/server/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') 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) ) -- cgit v1.2.3