Merge branch 'cache' of github.com:rakyll/oauth2 into cache
This commit is contained in:
6
jwt.go
6
jwt.go
@@ -56,6 +56,7 @@ type JWTConfig struct {
|
||||
opts *JWTOptions
|
||||
aud string
|
||||
signature []byte
|
||||
cache Cache
|
||||
}
|
||||
|
||||
// Options returns JWT options.
|
||||
@@ -143,3 +144,8 @@ func (c *JWTConfig) FetchToken(existing *Token) (token *Token, err error) {
|
||||
token.Expiry = time.Now().Add(time.Duration(b.ExpiresIn) * time.Second)
|
||||
return
|
||||
}
|
||||
|
||||
// Cache returns a cache if specified, otherwise nil.
|
||||
func (c *JWTConfig) Cache() Cache {
|
||||
return c.cache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user