Class: OAuth2::Provider::Rails::ControllerAuthentication::ClassMethods::AuthenticationFilter
- Inherits:
-
Object
- Object
- OAuth2::Provider::Rails::ControllerAuthentication::ClassMethods::AuthenticationFilter
- Defined in:
- lib/oauth2/provider/rails/controller_authentication.rb
Instance Method Summary collapse
- #filter(controller, &block) ⇒ Object
-
#initialize(scope = nil) ⇒ AuthenticationFilter
constructor
A new instance of AuthenticationFilter.
Constructor Details
#initialize(scope = nil) ⇒ AuthenticationFilter
Returns a new instance of AuthenticationFilter.
12 13 14 |
# File 'lib/oauth2/provider/rails/controller_authentication.rb', line 12 def initialize(scope = nil) @scope = scope end |
Instance Method Details
#filter(controller, &block) ⇒ Object
16 17 18 |
# File 'lib/oauth2/provider/rails/controller_authentication.rb', line 16 def filter(controller, &block) controller.request.env['oauth2'].authenticate_request! :scope => @scope, &block end |