Fix auth handler race condition (#28864)
This commit is contained in:
parent
529e169f89
commit
3967594b79
1 changed files with 5 additions and 0 deletions
|
|
@ -164,6 +164,11 @@ func logoutHandler(w http.ResponseWriter, r *http.Request) {
|
|||
func ensureAuthHandler(authObject auth.Auth) mux.MiddlewareFunc {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if next == nil {
|
||||
http.Error(w, "Not Found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
if authObject.GetAuthMode() == auth.Disabled {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue