Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

comment out admin mw

Hayden10f5da47270b
diff --git a/backend/app/api/middleware.go b/backend/app/api/middleware.go
index bb8f8983..c062ec2c 100644
--- a/backend/app/api/middleware.go
+++ b/backend/app/api/middleware.go
@@ -65,21 +65,19 @@ 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)
-}
+// 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 {