Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit ba38c2e

Browse files
committed
fix .paperspace/config.json apiKey shadowing explicit apiKey on js function calls
1 parent 6559407 commit ba38c2e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/method.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ function method(endpointSpec, methodParams, cb) {
104104
delete methodParams.accessToken;
105105
delete methodParams.access_token;
106106
} else {
107-
if (!maybeAuthApiKey) maybeAuthApiKey = processEnv.PAPERSPACE_API_KEY;
108-
if (!maybeAuthApiKey) maybeAuthApiKey = userConfig.getApiKey();
107+
if (!cacheObject.apiKey) {
108+
if (!maybeAuthApiKey) maybeAuthApiKey = processEnv.PAPERSPACE_API_KEY;
109+
if (!maybeAuthApiKey) maybeAuthApiKey = userConfig.getApiKey();
110+
}
109111
}
110112

111113
var methodHeaders = {};

0 commit comments

Comments
 (0)