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

This commit is contained in:
AJ ONeal 2017-11-24 01:00:06 +00:00 committed by Gogs
commit c59e23d114
1 changed files with 14 additions and 13 deletions

View File

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