Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions source/Core/Services/DefaultViewService/HttpAssets/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,33 @@ window.identityServer = (function () {
}
};
});

app.directive('iframeOnload', function () {
var model = identityServer.getModel();
return {
link: function (scope, elem, attrs) {
elem.on('load', function (event) {
if (!model.autoRedirect || !model.redirectUrl) return;
if ($("iframe.signout").length > 1) {
event.target.remove();
} else {
window.location = model.redirectUrl;
};
});
}
};
});
})();

(function () {
var model = identityServer.getModel();
angular.module("app").constant("Model", model);
if (model.autoRedirect && model.redirectUrl) {
if (model.autoRedirectDelay < 0) {
model.autoRedirectDelay = 0;
if (model.autoRedirectDelay > 0) {
window.setTimeout(function () {
window.location = model.redirectUrl;
}, model.autoRedirectDelay * 1000);
}
window.setTimeout(function () {
window.location = model.redirectUrl;
}, model.autoRedirectDelay * 1000);
}
})();

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ <h1>
Click <a ng-href="{{model.redirectUrl}}">here</a> to return to the
<span ng-bind="model.clientName"></span> application.
</div>
<iframe class="signout" ng-repeat="url in model.iFrameUrls" ng-src="{{url}}"></iframe>
<iframe class="signout" ng-repeat="url in model.iFrameUrls" ng-src="{{url}}" iframe-onload></iframe>
</div>