parent
485d5f111d
commit
198d440f97
@ -1,31 +0,0 @@ |
||||
<html> |
||||
|
||||
<body> |
||||
<script> |
||||
// Based on: https://manfredsteyer.github.io/angular-oauth2-oidc/docs/additional-documentation/silent-refresh.html |
||||
|
||||
const checks = [/[\?|&|#]code=/, /[\?|&|#]error=/, /[\?|&|#]token=/, /[\?|&|#]id_token=/]; |
||||
|
||||
function isResponse(str) { |
||||
let count = 0; |
||||
|
||||
if (!str) { |
||||
return false; |
||||
} |
||||
|
||||
for (let i = 0; i < checks.length; i++) { |
||||
if (str.match(checks[i])) return true; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
let message = isResponse(location.hash) ? location.hash : '#' + location.search; |
||||
|
||||
//console.log("Rafraîchissement silencieux de l'iframe affichée dans l'application parente, message: ", message); |
||||
|
||||
(window.opener || window.parent).postMessage(message, location.origin); |
||||
</script> |
||||
</body> |
||||
|
||||
</html> |
Loading…
Reference in new issue