jwt: increase leeway and add some tests

also export a constant for the Cookie name

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-10-11 14:14:21 +02:00
parent c4bc88cd2e
commit a768dac29d
6 changed files with 42 additions and 9 deletions

View File

@@ -1071,7 +1071,7 @@ func (s *httpdServer) refreshAdminToken(w http.ResponseWriter, r *http.Request,
func (s *httpdServer) updateContextFromCookie(r *http.Request) *http.Request {
_, err := jwt.FromContext(r.Context())
if err != nil {
_, err = r.Cookie(jwtCookieKey)
_, err = r.Cookie(jwt.CookieKey)
if err != nil {
return r
}