mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-18 13:06:32 +00:00
comment out admin mw
This commit is contained in:
parent
68204a4f22
commit
10f5da4727
1 changed files with 11 additions and 13 deletions
|
@ -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
|
// mwAdminOnly is a middleware that extends the mwAuthToken middleware to only allow
|
||||||
// requests from superusers.
|
// requests from superusers.
|
||||||
func (a *app) mwAdminOnly(next http.Handler) http.Handler {
|
// func (a *app) mwAdminOnly(next http.Handler) http.Handler {
|
||||||
|
// mw := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// usr := services.UseUserCtx(r.Context())
|
||||||
|
|
||||||
mw := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
// if !usr.IsSuperuser {
|
||||||
usr := services.UseUserCtx(r.Context())
|
// server.RespondUnauthorized(w)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
if !usr.IsSuperuser {
|
// next.ServeHTTP(w, r)
|
||||||
server.RespondUnauthorized(w)
|
// })
|
||||||
return
|
// return a.mwAuthToken(mw)
|
||||||
}
|
// }
|
||||||
|
|
||||||
next.ServeHTTP(w, r)
|
|
||||||
})
|
|
||||||
|
|
||||||
return a.mwAuthToken(mw)
|
|
||||||
}
|
|
||||||
|
|
||||||
// mqStripTrailingSlash is a middleware that will strip trailing slashes from the request path.
|
// mqStripTrailingSlash is a middleware that will strip trailing slashes from the request path.
|
||||||
func mwStripTrailingSlash(next http.Handler) http.Handler {
|
func mwStripTrailingSlash(next http.Handler) http.Handler {
|
||||||
|
|
Loading…
Reference in a new issue