Skip to content

Commit d121de8

Browse files
committed
Fix SSE frontend auth
1 parent 4d3d37e commit d121de8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/internal/api/middleware/sse_auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ func SSEAuth(next http.Handler) http.Handler {
2626
return
2727
}
2828

29-
if claims != nil {
29+
if claims == nil {
3030
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
3131
return
3232
}
3333

3434
userID := uint(claims["uid"].(float64))
3535
_, enabled, _ := user.IsEnabled(userID)
36-
if token == nil || !enabled {
36+
if !enabled {
3737
h.ResultErrorJSON(w, r, http.StatusUnauthorized, "Unauthorised", nil)
3838
return
3939
}

0 commit comments

Comments
 (0)