Module: Digestive::Auth
- Defined in:
- lib/digestive/auth.rb,
lib/digestive/auth/service.rb
Defined Under Namespace
Classes: Service
Instance Method Summary collapse
-
#authenticate(options = {}, &strategy) ⇒ Object
Convenience method to require authentication.
Instance Method Details
#authenticate(options = {}, &strategy) ⇒ Object
Convenience method to require authentication. If successful, will set the @current_user instance variable of the including object to the authenticated user.
29 30 31 32 33 34 35 |
# File 'lib/digestive/auth.rb', line 29 def authenticate(={}, &strategy) credentialed = [:credentialed] || ::User provider = [:provider] service = Service.new(credentialed, provider) service.authenticate(&strategy) @current_user = service.user end |