Controller for cross-domain iframes added

This commit is contained in:
2019-06-18 13:21:44 +00:00
parent e3405369ca
commit ee35696cd4
5 changed files with 58 additions and 30 deletions

View File

@ -31,10 +31,27 @@ $(document).ready(function(){
'color': '#FFF'
});
if (data.CrossDomainLogin) {
// Create iframes for other domains
console.log('CrossDomainLogin initiated');
// For reference:
// [
// "Result" => "Success",
// "Location" => $originalUri,
// "CrossDomainLogin" => $settings->Session['CrossDomainLogin'],
// "CookieDomains" => json_encode(array_diff($settings->Session['CookieDomains'], $_SERVER['HTTP_HOST']))
// ]);
var cookieDomains = json_decode(data.CookieDomains);
console.log(data.CookieDomains);
// let the client setup multiple iframes for all domains
// psuedo-code: foreach (cookieDomains as domain) { $.get(domain, ref=[action,token])}
// validate each request against JWT-tokens in database
// load all iframes parallel, show user progress and redirect once all iframes have finished loading; or after treshold of X ms has been reached
// origin domain should be exempted from the treshold (because origin domain can be different from current domain -due to traefik design).
}
console.log("Navigating to :" + data.Location);
// Finished (either succesfully or through timeout) cross-domain logins
window.location.replace(data.Location);
}, 2250);
} else {