skapi-js 1.0.47-beta.0 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.module.js +1 -1
- package/dist/skapi.module.js.map +1 -1
- package/js/methods/user.js +9 -1
- package/package.json +1 -1
package/js/methods/user.js
CHANGED
|
@@ -380,8 +380,16 @@ export function clientSecretRequest(params) {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
+
if (params.headers) {
|
|
384
|
+
for (let k in params.headers) {
|
|
385
|
+
if (typeof params.headers[k] === 'string' && params.headers[k].includes('$CLIENT_SECRET')) {
|
|
386
|
+
hasSecret = true;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
383
391
|
if (!hasSecret) {
|
|
384
|
-
throw new SkapiError(`At least one parameter value should include "$CLIENT_SECRET" in ${params.method.toLowerCase() === 'post' ? '"data"' : '"params"'}.`, { code: 'INVALID_PARAMETER' });
|
|
392
|
+
throw new SkapiError(`At least one parameter value should include "$CLIENT_SECRET" in ${params.method.toLowerCase() === 'post' ? '"data"' : '"params"'} or "headers".`, { code: 'INVALID_PARAMETER' });
|
|
385
393
|
}
|
|
386
394
|
return request.bind(this)("client-secret-request", params);
|
|
387
395
|
}
|