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

@@ -18,6 +18,7 @@ en:
unauthenticated: 'You need to sign in or sign up before continuing.'
unconfirmed: 'You have to confirm your account before continuing.'
locked: 'Your account is locked.'
nonexitent: 'Invalid email or password.'
invalid: 'Invalid email or password.'
invalid_token: 'Invalid authentication token.'
timeout: 'Your session expired, please sign in again to continue.'

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