Files
Okupa_mi_coche_-_Angular/src/silent-refresh.html

28 lines
607 B
HTML

<html>
<body>
<script>
var checks = [
/[\?|&|#]code=/,
/[\?|&|#]error=/,
/[\?|&|#]token=/,
/[\?|&|#]id_token=/
];
function isResponse(str) {
var count = 0;
if (!str) return false;
for (var i = 0; i < checks.length; i++) {
if (str.match(checks[i])) return true;
}
return false;
}
var message = isResponse(location.hash)
? location.hash
: '#' + location.search;
(window.opener || window.parent).postMessage(message, location.origin);
</script>
</body>
</html>