Merge branch 'no-timeout' of OAuth3/oauth3.js into v1.2
This commit is contained in:
commit
c59e23d114
|
@ -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]) {
|
||||||
|
|
Loading…
Reference in New Issue