mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-12-01 10:21:19 +01:00
Fix SSE frontend auth
This commit is contained in:
1 file changed
+2
-2
@@ -26,14 +26,14 @@ func SSEAuth(next http.Handler) http.Handler {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if claims != nil {
|
if claims == nil {
|
||||||
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
|
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
userID := uint(claims["uid"].(float64))
|
userID := uint(claims["uid"].(float64))
|
||||||
_, enabled, _ := user.IsEnabled(userID)
|
_, enabled, _ := user.IsEnabled(userID)
|
||||||
if token == nil || !enabled {
|
if !enabled {
|
||||||
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
|
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user