-
Notifications
You must be signed in to change notification settings - Fork 416
Open
Description
this is more like a question instead of an issue:
- context: we want to override
jwt.TimeFunc
to always readnow
from request header
func ApplyOverrideJWTTimeFunc(header http.Header) {
jwt.TimeFunc = OverrideJWTTimeFunc(header)
}
func OverrideJWTTimeFunc(header http.Header) func() time.Time {
return func() time.Time {
return time.Unix(GetRequestTime(header), 0)
}
}
// this func read time from request.header
func GetRequestTime(header http.Header)
- concern: because this override jwt globally, will it be thread-safe or any unexpected risk when we deploy to production
Metadata
Metadata
Assignees
Labels
No labels