Support alternate sign in error message when email record does not exist

By default, the nonexistent error is still identical to the :invalid
message, and must be customized by the developer to implement.
This commit is contained in:
Gabe Martin-Dempesy
2012-11-18 15:08:57 -08:00
parent 397fce1f9d
commit cde2229e59
2 changed files with 2 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ module Devise
class DatabaseAuthenticatable < Authenticatable
def authenticate!
resource = valid_password? && mapping.to.find_for_database_authentication(authentication_hash)
return fail(:invalid) unless resource
return fail(:nonexitent) unless resource
if validate(resource){ resource.valid_password?(password) }
resource.after_database_authentication