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); var callback = parseCallback(window.location.href);
if (callback) { if (callback) {
setupCheckLoginIframe(); return setupCheckLoginIframe().success(function() {
window.history.replaceState({}, null, callback.newUrl); window.history.replaceState({}, null, callback.newUrl);
processCallback(callback, initPromise); processCallback(callback, initPromise);
return; }).error(function (e) {
throw 'Could not initialize iframe';
});
} else if (initOptions) { } else if (initOptions) {
if (initOptions.token && initOptions.refreshToken) { if (initOptions.token && initOptions.refreshToken) {
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken); setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);