提交 595b8bc8 编写于 作者: J Jakub Kuźma

fixed http token authentication formatting

上级 07d34664
......@@ -401,16 +401,21 @@ def request_http_token_authentication(realm = "Application")
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?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册