forked from binarylogic/authlogic
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Released v1.3.0 (see changelog for compatibility issues)
- Loading branch information
1 parent
a15093e
commit 4c310ed
Showing
15 changed files
with
201 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,48 @@ | ||
module Authlogic | ||
module ControllerAdapters # :nodoc: | ||
# = Abstract Adapter | ||
# | ||
# Allows you to use Authlogic in any framework you want, not just rails. See tha RailsAdapter for an example of how to adapter Authlogic to work with your framework. | ||
class AbstractAdapter < SimpleDelegator | ||
class AbstractAdapter | ||
attr_accessor :controller | ||
|
||
def initialize(controller) | ||
self.controller = controller | ||
end | ||
|
||
def authenticate_with_http_basic(&block) | ||
@auth = Rack::Auth::Basic::Request.new(__getobj__.request.env) | ||
@auth = Rack::Auth::Basic::Request.new(controller.request.env) | ||
if @auth.provided? and @auth.basic? | ||
block.call(*@auth.credentials) | ||
else | ||
false | ||
end | ||
end | ||
|
||
def cookies | ||
controller.cookies | ||
end | ||
|
||
def params | ||
controller.params | ||
end | ||
|
||
def request | ||
controller.request | ||
end | ||
|
||
def request_content_type | ||
request.content_type | ||
end | ||
|
||
def session | ||
controller.session | ||
end | ||
|
||
private | ||
def method_missing(id, *args, &block) | ||
controller.send(id, *args, &block) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
166 changes: 92 additions & 74 deletions
166
lib/authlogic/orm_adapters/active_record_adapter/acts_as_authentic/config.rb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.