From d074d73fecf36f8f42dde4f33c72a8cdf34842b9 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sun, 16 Oct 2022 18:20:27 -0800 Subject: [PATCH] remove duplicate code --- backend/app/api/middleware.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/backend/app/api/middleware.go b/backend/app/api/middleware.go index ed92ff5..7db65aa 100644 --- a/backend/app/api/middleware.go +++ b/backend/app/api/middleware.go @@ -63,22 +63,6 @@ func (a *app) mwAuthToken(next http.Handler) http.Handler { }) } -// mwAdminOnly is a middleware that extends the mwAuthToken middleware to only allow -// requests from superusers. -// func (a *app) mwAdminOnly(next http.Handler) http.Handler { -// mw := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { -// usr := services.UseUserCtx(r.Context()) - -// if !usr.IsSuperuser { -// server.RespondUnauthorized(w) -// return -// } - -// next.ServeHTTP(w, r) -// }) -// return a.mwAuthToken(mw) -// } - // mqStripTrailingSlash is a middleware that will strip trailing slashes from the request path. func mwStripTrailingSlash(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -111,7 +95,6 @@ func (a *app) mwStructLogger(next http.Handler) http.Handler { log.Info(). Str("id", middleware.GetReqID(r.Context())). - Str("url", url). Str("method", r.Method). Str("remote_addr", r.RemoteAddr). Int("status", record.Status).