Method: Twilio::REST::TokenAuthStrategy#fetch_token

Defined in:
lib/twilio-ruby/auth_strategy/token_auth_strategy.rb

#fetch_tokenObject



21
22
23
24
25
26
# File 'lib/twilio-ruby/auth_strategy/token_auth_strategy.rb', line 21

def fetch_token
  @lock.synchronize do
    @token = @token_manager.fetch_access_token if @token.nil? || token_expired? || @token == ''
    return @token
  end
end