Class: Oauned::Strategy
- Inherits:
-
Devise::Strategies::Authenticatable
- Object
- Devise::Strategies::Authenticatable
- Oauned::Strategy
- Defined in:
- lib/oauned/strategy.rb
Instance Method Summary collapse
Instance Method Details
#access_token ⇒ Object
20 21 22 23 |
# File 'lib/oauned/strategy.rb', line 20 def access_token match = request..match(/^OAuth2 (.*)$/) if request. match.nil? ? nil : match[1] end |
#authenticate! ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/oauned/strategy.rb', line 10 def authenticate! resource = mapping.to.find_for_oauth_authentication access_token if resource success!(resource) else fail(:invalid) end end |
#valid? ⇒ Boolean
6 7 8 |
# File 'lib/oauned/strategy.rb', line 6 def valid? !access_token.nil? end |