Merge branch 'cache' of github.com:rakyll/oauth2 into cache

This commit is contained in:
Burcu Dogan
2014-05-21 15:24:41 +02:00
4 changed files with 83 additions and 0 deletions

6
jwt.go
View File

@@ -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
}