no timeout

This commit is contained in:
AJ ONeal 2017-11-24 00:49:35 +00:00
parent 215d3f0e92
commit 2c0b757c13
1 changed files with 14 additions and 13 deletions

View File

@ -1030,11 +1030,10 @@
} }
var timeout = opts.timeout; var timeout = opts.timeout;
if (opts.debug) { if ('background' === windowType) {
timeout = timeout || 3 * 60 * 1000; if (!timeout) {
} timeout = 7 * 1000;
else { }
timeout = timeout || ('background' === windowType ? 15 * 1000 : 3 * 60 * 1000);
} }
return new OAUTH3.PromiseA(function (resolve, reject) { return new OAUTH3.PromiseA(function (resolve, reject) {
@ -1056,14 +1055,16 @@
cleanup(); cleanup();
}; };
tok = setTimeout(function () { if (timeout) {
var err = new Error( tok = setTimeout(function () {
"the '" + windowType + "' request did not complete within " + Math.round(timeout / 1000) + "s" var err = new Error(
); "the '" + windowType + "' request did not complete within " + Math.round(timeout / 1000) + "s"
err.code = "E_TIMEOUT"; );
reject(err); err.code = "E_TIMEOUT";
cleanup(); reject(err);
}, timeout); cleanup();
}, timeout);
}
setTimeout(function () { setTimeout(function () {
if (!OAUTH3._browser._frames[state]) { if (!OAUTH3._browser._frames[state]) {