mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-03-13 17:28:12 -04:00
Fix SSE frontend auth
This commit is contained in:
parent
4d3d37eaed
commit
d121de808c
@ -26,14 +26,14 @@ func SSEAuth(next http.Handler) http.Handler {
|
||||
return
|
||||
}
|
||||
|
||||
if claims != nil {
|
||||
if claims == nil {
|
||||
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
|
||||
return
|
||||
}
|
||||
|
||||
userID := uint(claims["uid"].(float64))
|
||||
_, enabled, _ := user.IsEnabled(userID)
|
||||
if token == nil || !enabled {
|
||||
if !enabled {
|
||||
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user