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:
Toks
2014-01-24 13:52:43 -05:00
parent d49571226c
commit 744daa6c0c
3 changed files with 7 additions and 6 deletions

View File

@@ -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