-
@umputun hi! First call: // in auth.go
...
claims, tkn, err := a.JWTService.Get(r)
if err != nil {
onError(h, w, r, errors.Wrap(err, "can't get token"))
return
}
... then call: // in jwt.go
...
if !fromCookie && j.IsExpired(claims) {
return Claims{}, "", errors.New("token expired")
}
...
I suppose that token in header use for check (or check validation token) auth/autz only. When token refresh required, I should sent it using cookies. That's right? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I'm not sure what exactly you are expecting to happen in this case. With the So, unless I missed the intent, it works as designed, and the refresh in this case is the client's responsibility. |
Beta Was this translation helpful? Give feedback.
I'm not sure what exactly you are expecting to happen in this case. With the
SendJWTHeader
set the client (i.e., caller) controls what token is sent to the server. If the token is expired server can't do anything smart, as it doesn't control the storage (cookie) in this mode.So, unless I missed the intent, it works as designed, and the refresh in this case is the client's responsibility.