@google-cloud/common
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -316,2 +316,3 @@ "use strict"; | ||
const onAuthenticated = (err, authenticatedReqOpts) => { | ||
const authLibraryError = err; | ||
const autoAuthFailed = err && | ||
@@ -357,3 +358,11 @@ err.message.indexOf('Could not load the default credentials') > -1; | ||
else { | ||
activeRequest_ = util.makeRequest(authenticatedReqOpts, reqConfig, callback); | ||
activeRequest_ = util.makeRequest(authenticatedReqOpts, reqConfig, (apiResponseError, ...params) => { | ||
if (apiResponseError && | ||
apiResponseError.code === 401) { | ||
// Re-use the "Could not load the default credentials error" if | ||
// the API request failed due to missing credentials. | ||
apiResponseError = authLibraryError; | ||
} | ||
callback(apiResponseError, ...params); | ||
}); | ||
} | ||
@@ -360,0 +369,0 @@ }; |
@@ -7,2 +7,14 @@ # Changelog | ||
## [2.2.0](https://www.github.com/googleapis/nodejs-common/compare/v2.1.2...v2.2.0) (2019-09-11) | ||
### Bug Fixes | ||
* **docs:** remove anchor from reference doc link ([#474](https://www.github.com/googleapis/nodejs-common/issues/474)) ([81ebc1f](https://www.github.com/googleapis/nodejs-common/commit/81ebc1f)) | ||
### Features | ||
* return more helpful error when authentication fails ([#480](https://www.github.com/googleapis/nodejs-common/issues/480)) ([98d2b7f](https://www.github.com/googleapis/nodejs-common/commit/98d2b7f)) | ||
### [2.1.2](https://www.github.com/googleapis/nodejs-common/compare/v2.1.1...v2.1.2) (2019-08-14) | ||
@@ -9,0 +21,0 @@ |
{ | ||
"name": "@google-cloud/common", | ||
"description": "Common components for Cloud APIs Node.js Client Libraries", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"license": "Apache-2.0", | ||
@@ -51,3 +51,2 @@ "author": "Google Inc.", | ||
"@types/ncp": "^2.0.1", | ||
"@types/nock": "^10.0.0", | ||
"@types/node": "^11.13.0", | ||
@@ -67,3 +66,3 @@ "@types/proxyquire": "^1.3.28", | ||
"ncp": "^2.0.0", | ||
"nock": "^10.0.6", | ||
"nock": "^11.3.2", | ||
"nyc": "^14.0.0", | ||
@@ -75,4 +74,4 @@ "power-assert": "^1.6.1", | ||
"tmp": "0.1.0", | ||
"typescript": "~3.5.0" | ||
"typescript": "~3.6.0" | ||
} | ||
} |
@@ -83,3 +83,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
[client-docs]: https://googleapis.dev/nodejs/common/latest#reference | ||
[client-docs]: https://googleapis.dev/nodejs/common/latest | ||
@@ -91,3 +91,1 @@ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png | ||
[auth]: https://cloud.google.com/docs/authentication/getting-started | ||
<a name="reference"></a> |
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
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
109912
28
1855
90