Class: OmniAuth::Strategies::WIND::LogoutRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/omni_auth/strategies/w_i_n_d/logout_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(strategy, request) ⇒ LogoutRequest

Returns a new instance of LogoutRequest.



9
10
11
# File 'lib/omni_auth/strategies/w_i_n_d/logout_request.rb', line 9

def initialize(strategy, request)
  @strategy, @request = strategy, request
end

Instance Method Details

#call(options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/omni_auth/strategies/w_i_n_d/logout_request.rb', line 13

def call(options = {})
  @options = options

  begin
    result = single_sign_out_callback.call(*logout_request)
  rescue StandardError => err
    return @strategy.fail! :logout_request, err
  else
    result = [200,{},'OK'] if result == true || result.nil?
  ensure
    return unless result

    # TODO: Why does ActionPack::Response return [status,headers,body]
    # when Rack::Response#new wants [body,status,headers]? Additionally,
    # why does Rack::Response differ in argument order from the usual
    # Rack-like [status,headers,body] array?
    return Rack::Response.new(result[2],result[0],result[1]).finish
  end
end