Permalink
Browse files

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.
  • Loading branch information...
Gabe Martin-Dempesy
Gabe Martin-Dempesy committed Nov 18, 2012
1 parent 397fce1 commit cde2229e598d0b91e75c039ead4311fa6a89a2e9
Showing with 2 additions and 1 deletion.
  1. +1 −0 config/locales/en.yml
  2. +1 −1 lib/devise/strategies/database_authenticatable.rb
@@ -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.'
@@ -6,7 +6,7 @@ module Strategies
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

0 comments on commit cde2229

Please sign in to comment.