Class: Authlogic::ControllerAdapters::RailsAdapter

Inherits:
AbstractAdapter show all
Defined in:
lib/authlogic/controller_adapters/rails_adapter.rb

Overview

Adapts authlogic to work with rails. The point is to close the gap between what authlogic expects and what the rails controller object provides. Similar to how ActiveRecord has an adapter for MySQL, PostgreSQL, SQLite, etc.

Defined Under Namespace

Modules: RailsImplementation Classes: AuthlogicLoadedTooLateError

Instance Attribute Summary

Attributes inherited from AbstractAdapter

#controller

Instance Method Summary (collapse)

Methods inherited from AbstractAdapter

#initialize, #last_request_update_allowed?, #params, #request, #responds_to_last_request_update_allowed?, #responds_to_single_access_allowed?, #session, #single_access_allowed?

Constructor Details

This class inherits a constructor from Authlogic::ControllerAdapters::AbstractAdapter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Authlogic::ControllerAdapters::AbstractAdapter

Instance Method Details

- (Object) authenticate_with_http_basic(&block)



10
11
12
# File 'lib/authlogic/controller_adapters/rails_adapter.rb', line 10

def authenticate_with_http_basic(&block)
  controller.authenticate_with_http_basic(&block)
end


18
19
20
21
# File 'lib/authlogic/controller_adapters/rails_adapter.rb', line 18

def cookie_domain
  @cookie_domain_key ||= Rails::VERSION::STRING >= '2.3' ? :domain : :session_domain
  controller.request.session_options[@cookie_domain_key]
end

- (Object) cookies



14
15
16
# File 'lib/authlogic/controller_adapters/rails_adapter.rb', line 14

def cookies
  controller.send(:cookies)
end

- (Object) request_content_type



23
24
25
# File 'lib/authlogic/controller_adapters/rails_adapter.rb', line 23

def request_content_type
  request.format.to_s
end