During the course of attempting to implement token authentication in Rails, I ran into this behavior:
class AppController < ActionController::Base
before_filter :restrict_access
def restrict_access
authenticate_or_request_with_http_token do |token, options|
false
end
end
This will deny all requests, as expected.
However, if I change "false" to "return false", it accepts all requests.
def restrict_access
authenticate_or_request_with_http_token do |token, options|
return false
end
end
How is that possible?