The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-ui-login/reset-password/resetPassword.js

26 lines
674 B

Template.resetPassword.events({
'submit #login-card': function(event, instance) {
event.preventDefault();
var button = instance.$('button.resetpass');
RocketChat.Button.loading(button);
Accounts.resetPassword(FlowRouter.getParam('token'), instance.find('[name=newPassword]').value, function(error) {
RocketChat.Button.reset(button);
if (error) {
console.log(error);
swal({
title: t('Error_changing_password'),
type: 'error'
});
} else {
FlowRouter.go('home');
toastr.success(t('Password_changed_successfully'));
}
});
}
});
Template.resetPassword.onRendered(function() {
this.find('[name=newPassword]').focus();
});