Compare commits
4 Commits
6081e42d14
...
0.5
Author | SHA1 | Date | |
---|---|---|---|
75e8640439 | |||
dca8f74f25 | |||
21f272e9f0 | |||
5a2d3313e7 |
@ -72,23 +72,6 @@ $pageLayout['full_alt'] = <<<'FULL_ALT'
|
||||
</html>
|
||||
FULL_ALT;
|
||||
|
||||
$pageLayout['frames'] = <<<'FRAMES'
|
||||
<!DOCTYPE html>
|
||||
<html lang="nl">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>lucidAuth</title>
|
||||
<meta name="application-name" content="lucidAuth" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
|
||||
<script src="misc/script.iframe.js"></script>
|
||||
<script>%1$s</script>
|
||||
</head>
|
||||
<body>
|
||||
%2$s
|
||||
</body>
|
||||
</html>
|
||||
FRAMES;
|
||||
|
||||
$contentLayout['login'] = <<<'LOGIN'
|
||||
<script src="misc/script.index.js"></script>
|
||||
<section>
|
||||
|
@ -31,6 +31,8 @@
|
||||
}))[0];
|
||||
if (($cookieDomain && (is_null($httpOrigin) || $originDomain)) && setcookie('JWT', $queryString['token'], (time() + $settings->Session['Duration']), '/', '.' . $cookieDomain)) {
|
||||
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
|
||||
header('Access-Control-Allow-Credentials: true');
|
||||
header('Access-Control-Max-Age: 86400');
|
||||
header("HTTP/1.1 202 Accepted");
|
||||
exit;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
$.post("lucidAuth.setXDomainCookie.php", {
|
||||
do: "login",
|
||||
ref: $('#ref').val()
|
||||
})
|
||||
.done(function(data,_status) {
|
||||
if (data.Result === 'Success') {
|
||||
}
|
||||
});
|
||||
});
|
@ -31,18 +31,15 @@ $(document).ready(function(){
|
||||
'color': '#FFF'
|
||||
});
|
||||
if (data.CrossDomainLogin) {
|
||||
console.log('CrossDomainLogin initiated');
|
||||
// do ajax in parallel, show progress,
|
||||
// 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).
|
||||
|
||||
var cookieDomains = JSON.parse(data.CookieDomains);
|
||||
var XHR = [];
|
||||
cookieDomains.forEach(function(domain) {
|
||||
XHR.push($.get({
|
||||
url: "https://auth." + domain + "/lucidAuth.setXDomainCookie.php",
|
||||
url: "https://auth." + domain + "/lucidAuth.requestCookie.php",
|
||||
crossDomain: true,
|
||||
xhrFields: {
|
||||
withCredentials: true,
|
||||
},
|
||||
data: {
|
||||
ref: btoa(JSON.stringify({
|
||||
action: 'login',
|
||||
@ -52,12 +49,15 @@ console.log('CrossDomainLogin initiated');
|
||||
}));
|
||||
});
|
||||
$.when.apply($, XHR).then(function(){
|
||||
$.each(arguments, function(_index, arg) {
|
||||
console.log(JSON.stringify(arg));
|
||||
$.each(arguments, function(_index, _arg) {
|
||||
// Show progress somehow (maybe something like https://minicss.org/v2/progress)
|
||||
});
|
||||
});
|
||||
}
|
||||
// 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 {
|
||||
|
Reference in New Issue
Block a user