mirror of
https://github.com/marcopiovanello/yt-dlp-web-ui.git
synced 2025-12-05 19:06:41 -06:00
fixed authentication middleware
This commit is contained in:
@@ -8,15 +8,14 @@ import (
|
||||
)
|
||||
|
||||
func ApplyAuthenticationByConfig(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if config.Instance().RequireAuth {
|
||||
Authenticated(next)
|
||||
return
|
||||
}
|
||||
if config.Instance().UseOpenId {
|
||||
openid.Middleware(next)
|
||||
return
|
||||
}
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
handler := next
|
||||
|
||||
if config.Instance().RequireAuth {
|
||||
handler = Authenticated(handler)
|
||||
}
|
||||
if config.Instance().UseOpenId {
|
||||
handler = openid.Middleware(handler)
|
||||
}
|
||||
|
||||
return handler
|
||||
}
|
||||
Reference in New Issue
Block a user