When email change fails, give appropriate error message
Previously it would always say "Password was incorrect" on failure, whether that was the actual problem or not.
This commit is contained in:
@@ -9,7 +9,7 @@ class UserEmailChange
|
||||
|
||||
def process
|
||||
if User.authenticate(user.name, password).nil?
|
||||
false
|
||||
user.errors[:base] << "Password was incorrect"
|
||||
else
|
||||
user.email = new_email
|
||||
user.save
|
||||
|
||||
Reference in New Issue
Block a user