v1.18.x
Baris Usakli 11 years ago
parent bdb30976b5
commit bc8815cb94

@ -26,18 +26,22 @@ define(function() {
'_csrf': $('#csrf-token').val() '_csrf': $('#csrf-token').val()
}; };
$('#login').attr('disabled', 'disabled').html('Logging in...');
$('#login-error-notify').hide();
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: RELATIVE_PATH + '/login', url: RELATIVE_PATH + '/login',
data: loginData, data: loginData,
success: function(data, textStatus, jqXHR) { success: function(data, textStatus, jqXHR) {
if (!data.success) { if (!data.success) {
$('#login-error-notify').show(); $('#login-error-notify').show();
$('#login').removeAttr('disabled').html('Login');
} else { } else {
$('#login-error-notify').hide(); $('#login').html('Redirecting...');
if(!app.previousUrl) {
if(!app.previousUrl) { app.previousUrl = '/';
app.previousUrl = '/';
} }
if(app.previousUrl.indexOf('/reset/') != -1) if(app.previousUrl.indexOf('/reset/') != -1)
@ -50,6 +54,7 @@ define(function() {
}, },
error: function(data, textStatus, jqXHR) { error: function(data, textStatus, jqXHR) {
$('#login-error-notify').show(); $('#login-error-notify').show();
$('#login').removeAttr('disabled').html('Login');
}, },
dataType: 'json', dataType: 'json',
async: true, async: true,

Loading…
Cancel
Save