Module: Devise::Models::Castle

Extended by:
ActiveSupport::Concern
Defined in:
lib/devise_castle/model.rb

Instance Method Summary collapse

Instance Method Details

#valid_for_authentication?Boolean

Overwrites valid_for_authentication? from Devise::Models::Authenticatable for verifying whether a user is allowed to sign in or not.



40
41
42
43
44
45
46
47
48
49
# File 'lib/devise_castle/model.rb', line 40

def valid_for_authentication?
  return super unless persisted?

  if super
    true
  else
    # TODO: track unsuccessful login
    false
  end
end