Skip to content
Snippets Groups Projects
Commit 71a53750 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

insert a setTimeout between two main phases of assertion generation to prevent...

insert a setTimeout between two main phases of assertion generation to prevent unresponsive script warnings in IE8 - issue #1575
parent 31fdd885
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment