aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorJakub Kuźma <kuba@jah.pl>2012-06-12 13:00:17 +0200
committerJakub Kuźma <kuba@jah.pl>2012-06-12 13:00:17 +0200
commit595b8bc8f87d4400b1f83882bf079cacd265a9b4 (patch)
tree2567dcef5dd7032eabda9555d10726bb6d67d66e /actionpack/lib/action_controller/metal
parent07d346646f61dbf0ef020eefc4dc11e140b55baf (diff)
downloadrails-595b8bc8f87d4400b1f83882bf079cacd265a9b4.tar.gz
rails-595b8bc8f87d4400b1f83882bf079cacd265a9b4.tar.bz2
rails-595b8bc8f87d4400b1f83882bf079cacd265a9b4.zip
fixed http token authentication formatting
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/http_authentication.rb21
1 files changed, 13 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb
index 57bb0e2a32..76f380e583 100644
--- a/actionpack/lib/action_controller/metal/http_authentication.rb
+++ b/actionpack/lib/action_controller/metal/http_authentication.rb
@@ -401,16 +401,21 @@ module ActionController
end
end
- # If token Authorization header is present, call the login procedure with
- # the present token and options.
+ # If token Authorization header is present, call the login
+ # procedure with the present token and options.
#
- # controller - ActionController::Base instance for the current request.
- # login_procedure - Proc to call if a token is present. The Proc should
- # take 2 arguments:
- # authenticate(controller) { |token, options| ... }
+ # [controller]
+ # ActionController::Base instance for the current request.
#
- # Returns the return value of `&login_procedure` if a token is found.
- # Returns nil if no token is found.
+ # [login_procedure]
+ # Proc to call if a token is present. The Proc should take 2
+ # arguments:
+ #
+ # authenticate(controller) { |token, options| ... }
+ #
+ # Returns the return value of <tt>login_procedure</tt> if a
+ # token is found. Returns <tt>nil</tt> if no token is found.
+
def authenticate(controller, &login_procedure)
token, options = token_and_options(controller.request)
unless token.blank?