Skip to content

Commit

Permalink
Merge pull request #8489 from RocketChat/hotfix/reset-password-messag…
Browse files Browse the repository at this point in the history
…e-with-2fa

[FIX] Wrong message when reseting password and 2FA is enabled
  • Loading branch information
rodrigok committed Oct 17, 2017
1 parent aea9c73 commit 342ed3a
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ Template.resetPassword.events({
RocketChat.Button.reset(button);
if (error) {
console.log(error);
swal({
title: t('Error_changing_password'),
type: 'error'
});
if (error.error === 'totp-required') {
toastr.success(t('Password_changed_successfully'));
RocketChat.callbacks.run('userPasswordReset');
FlowRouter.go('login');
} else {
swal({
title: t('Error_changing_password'),
type: 'error'
});
}
} else {
FlowRouter.go('home');
toastr.success(t('Password_changed_successfully'));
Expand Down

0 comments on commit 342ed3a

Please sign in to comment.