From 71a537509b3f9fc4e8548d877946b9e85275a7fb Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel <lloyd@hilaiel.com> Date: Thu, 10 May 2012 16:42:23 -0600 Subject: [PATCH] insert a setTimeout between two main phases of assertion generation to prevent unresponsive script warnings in IE8 - issue #1575 --- resources/static/shared/user.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/resources/static/shared/user.js b/resources/static/shared/user.js index 5bf059997..167948840 100644 --- a/resources/static/shared/user.js +++ b/resources/static/shared/user.js @@ -943,18 +943,20 @@ BrowserID.User = (function() { network.serverTime(function(serverTime) { var sk = jwcrypto.loadSecretKeyFromObject(idInfo.priv); - // assertions are valid for 2 minutes - var expirationMS = serverTime.getTime() + (2 * 60 * 1000); - var expirationDate = new Date(expirationMS); - - jwcrypto.assertion.sign( - {}, {audience: audience, expiresAt: expirationDate}, - sk, - function(err, signedAssertion) { - assertion = jwcrypto.cert.bundle([idInfo.cert], signedAssertion); - storage.site.set(audience, "email", email); - complete(assertion); - }); + setTimeout(function() { + // assertions are valid for 2 minutes + var expirationMS = serverTime.getTime() + (2 * 60 * 1000); + var expirationDate = new Date(expirationMS); + + jwcrypto.assertion.sign( + {}, {audience: audience, expiresAt: expirationDate}, + sk, + function(err, signedAssertion) { + assertion = jwcrypto.cert.bundle([idInfo.cert], signedAssertion); + storage.site.set(audience, "email", email); + complete(assertion); + }); + }, 0); }, onFailure); } -- GitLab