diff --git a/auth/oauth2/corteza_token_store.go b/auth/oauth2/corteza_token_store.go index d2a662219..828053cfd 100644 --- a/auth/oauth2/corteza_token_store.go +++ b/auth/oauth2/corteza_token_store.go @@ -136,10 +136,6 @@ func (c tokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.To return nil, fmt.Errorf("failed to get refresh token: %w", err) } - if t.ExpiresAt.Before(*now()) { - //return nil, oauth2errors.ErrExpiredRefreshToken - } - return internal, t.Data.Unmarshal(internal) } diff --git a/auth/oauth2/oauth2.go b/auth/oauth2/oauth2.go index 400e4a472..e73b77408 100644 --- a/auth/oauth2/oauth2.go +++ b/auth/oauth2/oauth2.go @@ -34,6 +34,13 @@ func NewManager(opt options.AuthOpt, log *zap.Logger, cs oauth2.ClientStore, ts // token store manager.MapTokenStorage(ts) manager.MapClientStorage(cs) + // Change the default config for it to update refresh token timestamps + // else the refresh token timestamp remains the same + // + // @note do this so we don't change the default `manage` package var + rcfg := *manage.DefaultRefreshTokenCfg + rcfg.IsResetRefreshTime = true + manager.SetRefreshTokenCfg(&rcfg) manager.SetValidateURIHandler(func(baseURI, redirectURI string) (err error) { if baseURI == "" {