reset fix for t.js bug :rage3:

v1.18.x
Barış Soner Uşaklı 10 years ago
parent e45e204ba5
commit 37fe438c63

@ -24,6 +24,7 @@ define('forum/reset', function() {
successEl.addClass('hide').hide();
errorEl.removeClass('hide').show();
}
return false;
});
};

@ -31,22 +31,8 @@ define('forum/reset_code', function() {
window.location.href = RELATIVE_PATH + '/login';
});
}
return false;
});
// socket.emit('user.reset.valid', reset_code, function(err, valid) {
// if(err) {
// return app.alertError(err.message);
// }
// if (valid) {
// resetEl.prop('disabled', false);
// } else {
// var formEl = $('#reset-form');
// // Show error message
// $('#error').show();
// formEl.remove();
// }
// });
};
return ResetCode;

@ -52,15 +52,18 @@ Controllers.home = function(req, res, next) {
Controllers.reset = function(req, res, next) {
if (req.params.code) {
user.reset.validate(req.params.code, function(err, valid) {
if (err) {
return next(err);
}
res.render('reset_code', {
valid: valid,
reset_code: req.params.code ? req.params.code : null,
code: req.params.code ? req.params.code : null,
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[reset_password:reset_password]]', url: '/reset'}, {text: '[[reset_password:update_password]]'}])
});
});
} else {
res.render('reset', {
reset_code: req.params.code ? req.params.code : null,
code: req.params.code ? req.params.code : null,
breadcrumbs: helpers.buildBreadcrumbs([{text: '[[reset_password:reset_password]]'}])
});
}

Loading…
Cancel
Save