Merge branch 'no-timeout' of OAuth3/oauth3.js into v1.2

这个提交包含在:
AJ ONeal 2017-11-24 01:00:06 +00:00 提交者 Gogs
当前提交 c59e23d114

查看文件

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