mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user