Skip to content

Commit 6f0c4fa

Browse files
committed
Update silent-refresh.html script
This should cover both normal popup and normal login flow + implicit and code flows
1 parent 41a6ea0 commit 6f0c4fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs-src/implicit-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ This file is loaded into the hidden iframe after getting new tokens. Its only ta
154154
<html>
155155
<body>
156156
<script>
157-
window.parent.postMessage(location.hash || ('#' + location.search), location.origin);
157+
(window.opener || window.parent).postMessage(location.hash || ('#' + location.search), location.origin);
158158
</script>
159159
</body>
160160
</html>
@@ -190,4 +190,4 @@ To automatically refresh a token when/ some time before it expires, just call th
190190
this.oauthService.setupAutomaticSilentRefresh();
191191
```
192192

193-
By default, this event is fired after 75% of the token's life time is over. You can adjust this factor by setting the property ``timeoutFactor`` to a value between 0 and 1. For instance, 0.5 means, that the event is fired after half of the life time is over and 0.33 triggers the event after a third.
193+
By default, this event is fired after 75% of the token's life time is over. You can adjust this factor by setting the property ``timeoutFactor`` to a value between 0 and 1. For instance, 0.5 means, that the event is fired after half of the life time is over and 0.33 triggers the event after a third.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<body>
33
<script>
4-
parent.postMessage(location.hash, location.origin);
4+
(window.opener || window.parent).postMessage(location.hash || ('#' + location.search), location.origin);
55
</script>
66
</body>
7-
</html>
7+
</html>

0 commit comments

Comments
 (0)