diff --git a/public/src/forum/login.js b/public/src/forum/login.js index 3bdc2c69b0..a414f39e4e 100644 --- a/public/src/forum/login.js +++ b/public/src/forum/login.js @@ -26,18 +26,22 @@ define(function() { '_csrf': $('#csrf-token').val() }; + $('#login').attr('disabled', 'disabled').html('Logging in...'); + $('#login-error-notify').hide(); + $.ajax({ type: "POST", url: RELATIVE_PATH + '/login', data: loginData, success: function(data, textStatus, jqXHR) { + if (!data.success) { $('#login-error-notify').show(); + $('#login').removeAttr('disabled').html('Login'); } else { - $('#login-error-notify').hide(); - - if(!app.previousUrl) { - app.previousUrl = '/'; + $('#login').html('Redirecting...'); + if(!app.previousUrl) { + app.previousUrl = '/'; } if(app.previousUrl.indexOf('/reset/') != -1) @@ -50,6 +54,7 @@ define(function() { }, error: function(data, textStatus, jqXHR) { $('#login-error-notify').show(); + $('#login').removeAttr('disabled').html('Login'); }, dataType: 'json', async: true, diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index ddcf205c7e..3acbf62c74 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -135,7 +135,7 @@