mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 08:08:00 -05:00
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:
@@ -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 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
|
||||
|
||||
Reference in New Issue
Block a user