mongodb-stitch
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -592,4 +592,2 @@ 'use strict'; | ||
value: function _do(resource, method, options) { | ||
var _this5 = this; | ||
options = Object.assign({}, { | ||
@@ -616,15 +614,2 @@ refreshOnFailure: true, | ||
// If access token is expired, proactively get a new one | ||
if (!options.useRefreshToken) { | ||
if (this.auth.isAccessTokenExpired()) { | ||
return this.auth.refreshToken().then(function () { | ||
options.refreshOnFailure = false; | ||
return _this5._do(resource, method, options); | ||
}); | ||
} | ||
fetchArgs.headers.Authorization = 'Bearer ' + token; | ||
return this._fetch(url, fetchArgs, resource, method, options); | ||
} | ||
fetchArgs.headers.Authorization = 'Bearer ' + token; | ||
@@ -631,0 +616,0 @@ return this._fetch(url, fetchArgs, resource, method, options); |
@@ -17,4 +17,4 @@ 'use strict'; | ||
var version = 'unknown'; | ||
if (typeof "3.0.6" !== 'undefined') { | ||
version = "3.0.6"; | ||
if (typeof "3.0.7" !== 'undefined') { | ||
version = "3.0.7"; | ||
} | ||
@@ -21,0 +21,0 @@ var SDK_VERSION = exports.SDK_VERSION = version; |
{ | ||
"name": "mongodb-stitch", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "", |
@@ -525,15 +525,2 @@ /* global window, fetch */ | ||
// If access token is expired, proactively get a new one | ||
if (!options.useRefreshToken) { | ||
if (this.auth.isAccessTokenExpired()) { | ||
return this.auth.refreshToken().then(() => { | ||
options.refreshOnFailure = false; | ||
return this._do(resource, method, options); | ||
}); | ||
} | ||
fetchArgs.headers.Authorization = `Bearer ${token}`; | ||
return this._fetch(url, fetchArgs, resource, method, options); | ||
} | ||
fetchArgs.headers.Authorization = `Bearer ${token}`; | ||
@@ -540,0 +527,0 @@ return this._fetch(url, fetchArgs, resource, method, options); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
4162805
20353