Update JWT to use Extended rather than Extend
parent
f6aedc85a0
commit
778cb19f57
|
@ -122,8 +122,8 @@ func (j *JWT) Create(ctx context.Context, user Principal) (Token, error) {
|
|||
return Token(t), nil
|
||||
}
|
||||
|
||||
// ExtendPrincipal sets the expires at to be the current time plus the extention into the future
|
||||
func (j *JWT) ExtendPrincipal(ctx context.Context, principal Principal, extension time.Duration) (Principal, error) {
|
||||
// ExtendedPrincipal sets the expires at to be the current time plus the extention into the future
|
||||
func (j *JWT) ExtendedPrincipal(ctx context.Context, principal Principal, extension time.Duration) (Principal, error) {
|
||||
// Extend the time of expiration. Do not change IssuedAt as the
|
||||
// lifetime of the token is extended, but, NOT the original time
|
||||
// of issue. This is used to enforce a maximum lifetime of a token
|
||||
|
|
|
@ -3,4 +3,4 @@ package oauth2
|
|||
import "time"
|
||||
|
||||
// DefaultNowTime returns UTC time at the present moment
|
||||
const DefaultNowTime = func() time.Time { return time.Now().UTC() }
|
||||
var DefaultNowTime = func() time.Time { return time.Now().UTC() }
|
||||
|
|
Loading…
Reference in New Issue