Class: OmniAuth::Strategies::CAS::LogoutRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/strategies/cas/logout_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(strategy, request) ⇒ LogoutRequest

Returns a new instance of LogoutRequest.


5
6
7
# File 'lib/omniauth/strategies/cas/logout_request.rb', line 5

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

Instance Method Details

#call(options = {}) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/omniauth/strategies/cas/logout_request.rb', line 9

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