Added external library NProgress and ajax-timeouts
This commit is contained in:
@ -40,25 +40,27 @@ $(document).ready(function(){
|
||||
xhrFields: {
|
||||
withCredentials: true,
|
||||
},
|
||||
timeout: 750,
|
||||
// origin domain should be exempted from timeout
|
||||
// (because origin domain can/will be different from current domain --due to traefik design).
|
||||
data: {
|
||||
ref: btoa(JSON.stringify({
|
||||
action: 'login',
|
||||
token: data.SecureToken
|
||||
}))
|
||||
}
|
||||
}).done(function() {
|
||||
NProgress.inc(1 / XHR.length);
|
||||
}));
|
||||
});
|
||||
$.when.apply($, XHR).then(function(){
|
||||
$.each(arguments, function(_index, _arg) {
|
||||
// Show progress somehow (maybe something like https://minicss.org/v2/progress)
|
||||
// Finished cross-domain logins (either succesfully or through timeout)
|
||||
NProgress.done();
|
||||
window.location.replace(data.Location);
|
||||
});
|
||||
});
|
||||
}
|
||||
// Finished (either succesfully or through timeout) cross-domain logins
|
||||
// redirect once all finished loading or timeout after $X ms
|
||||
// origin domain should be exempted from timeout
|
||||
// (because origin domain can/will be different from current domain --due to traefik design).
|
||||
//window.location.replace(data.Location);
|
||||
}, 2250);
|
||||
} else {
|
||||
$('#btnlogin').css({
|
||||
|
Reference in New Issue
Block a user