Module: Devise::Models::StormpathAuthenticatable::ClassMethods

Defined in:
lib/devise/models/stormpath_authenticatable.rb

Instance Method Summary collapse

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
     = ::Stormpath::Rails::Client.(attributes[:username], attributes[:password])
    return self.where(stormpath_url: .get_href).first
  rescue ResourceError => error
    return nil
  end
end