This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
Make LoggedOut page wait to redirect until iframes are loaded #3519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses issue #3212, where PostSignOutAutoRedirectDelay=0 often causes the page to redirect before the single sign-out iframes have loaded. Increasing PostSignOutAutoRedirectDelay prevents the error, but involves a trade-off between allowing for slow connections and causing unnecessarily long delays.
This PR detects when the iframes are loaded by adding onload event handlers using an angular directive. When PostSignOutAutoRedirectDelay==0, it redirects when all iframes have loaded. When PostSignOutAutoRedirectDelay > 0, it will force a redirect after the delay has passed, but will redirect sooner if the iframes are finished. This maintains existing functionality by allowing a maximum delay to be specified, while otherwise providing the fastest possible sign-out flow.
A similar approach is used in IdentityServer4 by redirecting on window-load. Since we need to use IdentityServer3 for a while longer, I was looking for a way to accomplish the same thing using its angular-generated signout iframes.