[FIX] Wrong message when reseting password and 2FA is enabled

pull/8489/head
Rodrigo Nascimento 8 years ago
parent dd0f358149
commit 658203ea49
No known key found for this signature in database
GPG Key ID: CFCE33B7B01AC335
  1. 14
      packages/rocketchat-ui-login/client/reset-password/resetPassword.js

@ -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'));

Loading…
Cancel
Save