Module: Castle::API::Authenticate
- Defined in:
- lib/castle/api/authenticate.rb
Class Method Summary collapse
-
.call(options = {}) ⇒ Object
return [Hash].
Class Method Details
.call(options = {}) ⇒ Object
return [Hash]
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/castle/api/authenticate.rb', line 9 def call( = {}) unless [:no_symbolize] = Castle::Utils::DeepSymbolizeKeys.call( || {}) end .delete(:no_symbolize) http = .delete(:http) config = .delete(:config) || Castle.config response = Castle::API.call( Castle::Commands::Authenticate.build(), {}, http, config ) response.merge(failover: false, failover_reason: nil) rescue Castle::RequestError, Castle::InternalServerError => e unless config.failover_strategy == :throw return Castle::Failover::PrepareResponse.new([:user_id], reason: e.to_s).call end raise e end |