From 5162c5de87849237d9575204d22fe0ce3ed22363 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Mon, 16 Sep 2024 20:11:02 +0200 Subject: [PATCH] WebUIs: add a nil check for token in refresh cookie method token should never be null here because we have an authenticated user however add the same check as elsewhere Signed-off-by: Nicola Murino --- internal/httpd/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/httpd/server.go b/internal/httpd/server.go index 88020a34..a4b276fe 100644 --- a/internal/httpd/server.go +++ b/internal/httpd/server.go @@ -1001,7 +1001,7 @@ func (s *httpdServer) checkCookieExpiration(w http.ResponseWriter, r *http.Reque return } token, claims, err := jwtauth.FromContext(r.Context()) - if err != nil { + if err != nil || token == nil { return } tokenClaims := jwtTokenClaims{}