balena-request
Advanced tools
Comparing version 11.1.0 to 11.2.0-explicit-token-refresh-base-url-268d84412ce90255a7e668d5731f8de8a6f897b5
@@ -29,2 +29,3 @@ "use strict"; | ||
* @param {import('balena-auth').default} options.auth | ||
* @param {string} [options.tokenRefreshBaseUrl] | ||
* @param {boolean} options.debug | ||
@@ -35,3 +36,3 @@ * @param {number} options.retries | ||
*/ | ||
function getRequest({ auth, debug = false, retries = 0, isBrowser = false, interceptors = [], }) { | ||
function getRequest({ auth, tokenRefreshBaseUrl, debug = false, retries = 0, isBrowser = false, interceptors = [], }) { | ||
const requestAsync = utils.getRequestAsync(); | ||
@@ -66,3 +67,3 @@ const requestStream = isBrowser | ||
if (shouldRefreshKey) { | ||
yield exports.refreshToken({ baseUrl }); | ||
yield exports.refreshToken({ baseUrl: tokenRefreshBaseUrl !== null && tokenRefreshBaseUrl !== void 0 ? tokenRefreshBaseUrl : baseUrl }); | ||
} | ||
@@ -69,0 +70,0 @@ } |
@@ -7,2 +7,7 @@ # Change Log | ||
# v11.2.0 | ||
## (2020-08-13) | ||
* Add tokenRefreshBaseUrl option to limit the refresh token targets [Thodoris Greasidis] | ||
# v11.1.0 | ||
@@ -9,0 +14,0 @@ ## (2020-07-16) |
@@ -28,2 +28,3 @@ /* | ||
* @param {import('balena-auth').default} options.auth | ||
* @param {string} [options.tokenRefreshBaseUrl] | ||
* @param {boolean} options.debug | ||
@@ -36,2 +37,3 @@ * @param {number} options.retries | ||
auth, | ||
tokenRefreshBaseUrl, | ||
debug = false, | ||
@@ -86,3 +88,3 @@ retries = 0, | ||
if (shouldRefreshKey) { | ||
await exports.refreshToken({ baseUrl }); | ||
await exports.refreshToken({ baseUrl: tokenRefreshBaseUrl ?? baseUrl }); | ||
} | ||
@@ -89,0 +91,0 @@ } |
{ | ||
"name": "balena-request", | ||
"version": "11.1.0", | ||
"version": "11.2.0-explicit-token-refresh-base-url-268d84412ce90255a7e668d5731f8de8a6f897b5", | ||
"description": "Balena HTTP client", | ||
@@ -5,0 +5,0 @@ "main": "build/request.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169168
1873
1