Fixed regression in registration/login pages

Error message was always the CSRF message, even when it wasn't
a CSRF issue. re: #4593
v1.18.x
Julian Lam 9 years ago
parent a44fdeec49
commit 60e4ddc145

@ -31,7 +31,7 @@ define('forum/login', ['csrf', 'translator'], function(csrf, translator) {
window.location.href = data + '?loggedin'; window.location.href = data + '?loggedin';
}, },
error: function(data, status) { error: function(data, status) {
if (data.status === 403 && data.statusText === 'Forbidden') { if (data.status === 403 && data.responseText === 'Forbidden') {
window.location.href = config.relative_path + '/login?error=csrf-invalid'; window.location.href = config.relative_path + '/login?error=csrf-invalid';
} else { } else {
errorEl.find('p').translateText(data.responseText); errorEl.find('p').translateText(data.responseText);

@ -99,7 +99,7 @@ define('forum/register', ['csrf', 'translator'], function(csrf, translator) {
}, },
error: function(data) { error: function(data) {
translator.translate(data.responseText, config.defaultLang, function(translated) { translator.translate(data.responseText, config.defaultLang, function(translated) {
if (data.status === 403 && data.statusText === 'Forbidden') { if (data.status === 403 && data.responseText === 'Forbidden') {
window.location.href = config.relative_path + '/register?error=csrf-invalid'; window.location.href = config.relative_path + '/register?error=csrf-invalid';
} else { } else {
errorEl.find('p').text(translated); errorEl.find('p').text(translated);

Loading…
Cancel
Save