From c841e4d32d59398c39f309096c38917d5cf7e646 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 4 Jun 2022 22:41:25 -0700 Subject: [PATCH] Fix middleware attached to wrong endpoint --- router/router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/router.go b/router/router.go index 9f505db4e..1efbb5dd2 100644 --- a/router/router.go +++ b/router/router.go @@ -355,8 +355,8 @@ func Start() error { // Start auth flow http.HandleFunc("/api/auth/indieauth", middleware.RequireUserAccessToken(indieauth.StartAuthFlow)) - http.HandleFunc("/api/auth/indieauth/callback", middleware.RequireAdminAuth(indieauth.HandleRedirect)) - http.HandleFunc("/api/auth/provider/indieauth", indieauth.HandleAuthEndpoint) + http.HandleFunc("/api/auth/indieauth/callback", indieauth.HandleRedirect) + http.HandleFunc("/api/auth/provider/indieauth", middleware.RequireAdminAuth(indieauth.HandleAuthEndpoint)) http.HandleFunc("/api/auth/fediverse", middleware.RequireUserAccessToken(fediverseauth.RegisterFediverseOTPRequest)) http.HandleFunc("/api/auth/fediverse/verify", fediverseauth.VerifyFediverseOTPRequest)