lib/setsuzoku/api_strategy.rb in setsuzoku-0.11.0 vs lib/setsuzoku/api_strategy.rb in setsuzoku-0.11.5
- old
+ new
@@ -78,10 +78,10 @@
{ actions: self.plugin.api_actions, url: self.plugin.api_base_url }
end
self.external_api_handler.call_external_api_wrapper(plugin: self.plugin, request: request, action_details: action_details) do
begin
# raise if the token is invalid and needs refreshed, but don't raise if we are trying to get a refresh token
- raise Setsuzoku::Exception::InvalidAuthCredentials.new unless (request.action == :refresh_token || self.auth_strategy.auth_credential_valid?)
+ raise Setsuzoku::Exception::InvalidAuthCredentials.new unless (strategy == :auth || self.auth_strategy.auth_credential_valid?)
raw_response = self.perform_external_call(request: request, action_details: action_details, **options)
formatted_response = self.parse_response(response: raw_response, response_type: action_details[:actions][request.action][:response_type])
success = true
rescue Exception => e
exception = e