Eneko Nieto
2021-01-18 01:07:29 +01:00
parent 63dabe3357
commit 83be283757
43 changed files with 1469 additions and 551 deletions

27
src/silent-refresh.html Normal file
View File

@@ -0,0 +1,27 @@
<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>