GT2/GT2-iOS/node_modules/auth0-js/test/support/config.js

24 lines
552 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
/* jshint unused: false */
function forceLogout (domain, callback) {
var endpoint = 'https://' + domain + '/logout';
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
if (iframe.attachEvent) {
iframe.attachEvent('onload', iframeloaded);
} else {
iframe.onload = iframeloaded;
}
function iframeloaded () {
if (iframe.src !== endpoint) {
throw new Error('Could not load logout endpoint via iFrame');
}
callback();
}
iframe.src = endpoint;
document.body.appendChild(iframe);
}