processInit should return a promise for setupCheckLoginIframe and should only call processCallback if that setupCheckLoginIframe is successful

This commit is contained in:
Samuel Mendenhall 2017-10-13 10:18:34 -04:00 committed by Stian Thorgersen
parent b4532ec629
commit ca324c29e8

View file

@ -159,10 +159,12 @@
var callback = parseCallback(window.location.href);
if (callback) {
setupCheckLoginIframe();
window.history.replaceState({}, null, callback.newUrl);
processCallback(callback, initPromise);
return;
return setupCheckLoginIframe().success(function() {
window.history.replaceState({}, null, callback.newUrl);
processCallback(callback, initPromise);
}).error(function (e) {
throw 'Could not initialize iframe';
});
} else if (initOptions) {
if (initOptions.token && initOptions.refreshToken) {
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);