Sha256: e55c5286ebe06455a0f50544465060bba2f36b375f0b15242bfc087696df7adb

Contents?: true

Size: 361 Bytes

Versions: 2

Compression:

Stored size: 361 Bytes

Contents

# frozen_string_literal: true

class GlobusClient
  # Wraps API operations to request new access token if expired
  class TokenWrapper
    def self.refresh(config, &block)
      yield
    rescue UnexpectedResponse::UnauthorizedError
      config.token = Authenticator.token(config.client_id, config.client_secret, config.auth_url)
      yield
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
globus_client-0.9.0 lib/globus_client/token_wrapper.rb
globus_client-0.8.0 lib/globus_client/token_wrapper.rb