Sha256: 2c2e40713946dfbc45c611afe8270217d519d06e4005f3122fd472405d9b268f

Contents?: true

Size: 671 Bytes

Versions: 27

Compression:

Stored size: 671 Bytes

Contents

class AuthlogicConnect::CallbackFilter
  def initialize(app)
    @app = app
  end
  
  # this intercepts how the browser interprets the url.
  # so we override it and say,
  # "if we've stored a variable in the session called :auth_callback_method,
  # then convert that into a POST call so we re-call the original method"
  def call(env)
    if env["rack.session"].nil?
      raise "Make sure you are setting the session in Rack too!  Place this in config/application.rb"
    end
    unless env["rack.session"][:auth_callback_method].blank?
      env["REQUEST_METHOD"] = env["rack.session"].delete(:auth_callback_method).to_s.upcase
    end
    @app.call(env)
  end
end

Version data entries

27 entries across 27 versions & 8 rubygems

Version Path
robdimarco-authlogic-connect-0.0.6 lib/authlogic_connect/callback_filter.rb
anideo-authlogic-connect-0.0.6 lib/authlogic_connect/callback_filter.rb
jspooner-authlogic-connect-0.0.20 lib/authlogic_connect/callback_filter.rb
jspooner-authlogic-connect-0.0.19 lib/authlogic_connect/callback_filter.rb
foreverman-authlogic-connect-0.0.4 lib/authlogic_connect/callback_filter.rb
foreverman-authlogic-connect-0.0.3 lib/authlogic_connect/callback_filter.rb
foreverman-authlogic-connect-0.0.2 lib/authlogic_connect/callback_filter.rb
foreverman-authlogic-connect-0.0.1 lib/authlogic_connect/callback_filter.rb
foreverman-authlogic-connect-0.0.6 lib/authlogic_connect/callback_filter.rb
authlogic-connect-andrewacove-0.5.7 lib/authlogic_connect/callback_filter.rb
authlogic-connect-0.0.6 lib/authlogic_connect/callback_filter.rb
authlogic-connect-0.0.5.1 lib/authlogic_connect/callback_filter.rb
authlogic-connect-0.0.5 lib/authlogic_connect/callback_filter.rb
authlogic-connect-andrewacove-0.5.6 lib/authlogic_connect/callback_filter.rb
authlogic-connect-andrewacove-0.5.5 lib/authlogic_connect/callback_filter.rb
authlogic-connect-andrewacove-0.5.4 lib/authlogic_connect/callback_filter.rb
authlogic-connect-andrewacove-0.5.2 lib/authlogic_connect/callback_filter.rb
authlogic-connect-andrewacove-0.5.0 lib/authlogic_connect/callback_filter.rb
authlogic-connect-0.0.4.06 lib/authlogic_connect/callback_filter.rb
authlogic-connect-x-0.0.4.05x lib/authlogic_connect/callback_filter.rb