@dvsa/appdev-api-common 0.10.0 → 0.10.2
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/auth/client-credentials.js +14 -7
- package/package.json +6 -1
|
@@ -54,13 +54,20 @@ class ClientCredentials {
|
|
|
54
54
|
const response = await fetch(this.tokenUrl, {
|
|
55
55
|
method: "POST",
|
|
56
56
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
57
|
-
body:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
body: this.resource
|
|
58
|
+
? (0, node_querystring_1.stringify)({
|
|
59
|
+
grant_type: ClientCredentials.grantType,
|
|
60
|
+
client_id: this.clientId,
|
|
61
|
+
client_secret: this.clientSecret,
|
|
62
|
+
scope: this.scope,
|
|
63
|
+
resource: this.resource,
|
|
64
|
+
})
|
|
65
|
+
: (0, node_querystring_1.stringify)({
|
|
66
|
+
grant_type: ClientCredentials.grantType,
|
|
67
|
+
client_id: this.clientId,
|
|
68
|
+
client_secret: this.clientSecret,
|
|
69
|
+
scope: this.scope,
|
|
70
|
+
}),
|
|
64
71
|
});
|
|
65
72
|
if (!response.ok) {
|
|
66
73
|
console.error("Error fetching client credentials", response);
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvsa/appdev-api-common",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"keywords": ["dvsa", "nodejs", "typescript"],
|
|
5
5
|
"author": "DVSA",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/dvsa/appdev-packages.git",
|
|
9
|
+
"directory": "packages/appdev-common"
|
|
10
|
+
},
|
|
6
11
|
"description": "Utils library for common API functionality",
|
|
7
12
|
"publishConfig": {
|
|
8
13
|
"directory": "dist",
|