Module: Devise::Models::StormpathAuthenticatable::ClassMethods
- Defined in:
- lib/devise/models/stormpath_authenticatable.rb
Instance Method Summary collapse
-
#authenticate_with_stormpath(attributes = {}) ⇒ Object
TODO support login with email.
Instance Method Details
#authenticate_with_stormpath(attributes = {}) ⇒ Object
TODO support login with email
25 26 27 28 29 30 31 32 |
# File 'lib/devise/models/stormpath_authenticatable.rb', line 25 def authenticate_with_stormpath(attributes={}) begin account = ::Stormpath::Rails::Client.authenticate_account(attributes[:username], attributes[:password]) return self.where(stormpath_url: account.get_href).first rescue ResourceError => error return nil end end |