Fixed regression in registration/login pages

Error message was always the CSRF message, even when it wasn't
a CSRF issue. re: #4593
This commit is contained in:
Julian Lam
2016-05-11 14:19:28 -04:00
parent a44fdeec49
commit 60e4ddc145
2 changed files with 2 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ define('forum/login', ['csrf', 'translator'], function(csrf, translator) {
window.location.href = data + '?loggedin';
},
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';
} else {
errorEl.find('p').translateText(data.responseText);

View File

@@ -99,7 +99,7 @@ define('forum/register', ['csrf', 'translator'], function(csrf, translator) {
},
error: function(data) {
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';
} else {
errorEl.find('p').text(translated);