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 <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-09-16 20:11:02 +02:00
parent c2aed5ee92
commit 5162c5de87

View File

@@ -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{}