Class: MaisOrcidClient::TokenWrapper
- Inherits:
-
Object
- Object
- MaisOrcidClient::TokenWrapper
- Defined in:
- lib/mais_orcid_client/token_wrapper.rb
Overview
Wraps API operations to request new access token if expired
Class Method Summary collapse
Class Method Details
.refresh(config) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/mais_orcid_client/token_wrapper.rb', line 6 def self.refresh(config) yield rescue UnexpectedResponse::UnauthorizedError config.token = Authenticator.token(config.client_id, config.client_secret, config.token_url) yield end |