diff --git a/resources/static/shared/user.js b/resources/static/shared/user.js index 5bf0599972680e19aa29b35da6bd99503feaa3fa..1679488400632061aab85e12603afc5b273393ac 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); }