@logto/node 2.2.0 → 2.2.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/lib/edge/index.cjs +3 -3
- package/lib/edge/index.js +3 -3
- package/package.json +2 -2
package/lib/edge/index.cjs
CHANGED
|
@@ -14,12 +14,12 @@ class LogtoClient extends client.default {
|
|
|
14
14
|
requester: BaseClient.createRequester(config.appSecret
|
|
15
15
|
? async (...args) => {
|
|
16
16
|
const [input, init] = args;
|
|
17
|
+
// Encode to base64 using btoa
|
|
18
|
+
const base64Credentials = btoa(`${config.appId}:${config.appSecret ?? ''}`);
|
|
17
19
|
return fetch(input, {
|
|
18
20
|
...init,
|
|
19
21
|
headers: {
|
|
20
|
-
Authorization: `Basic ${
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
22
|
-
`${config.appId}:${config.appSecret}`, 'utf8').toString('base64')}`,
|
|
22
|
+
Authorization: `Basic ${base64Credentials}`,
|
|
23
23
|
...init?.headers,
|
|
24
24
|
},
|
|
25
25
|
});
|
package/lib/edge/index.js
CHANGED
|
@@ -11,12 +11,12 @@ class LogtoClient extends LogtoNodeBaseClient {
|
|
|
11
11
|
requester: createRequester(config.appSecret
|
|
12
12
|
? async (...args) => {
|
|
13
13
|
const [input, init] = args;
|
|
14
|
+
// Encode to base64 using btoa
|
|
15
|
+
const base64Credentials = btoa(`${config.appId}:${config.appSecret ?? ''}`);
|
|
14
16
|
return fetch(input, {
|
|
15
17
|
...init,
|
|
16
18
|
headers: {
|
|
17
|
-
Authorization: `Basic ${
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
19
|
-
`${config.appId}:${config.appSecret}`, 'utf8').toString('base64')}`,
|
|
19
|
+
Authorization: `Basic ${base64Credentials}`,
|
|
20
20
|
...init?.headers,
|
|
21
21
|
},
|
|
22
22
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/node",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/src/index.cjs",
|
|
6
6
|
"module": "./lib/src/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"directory": "packages/node"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@logto/client": "^2.3.
|
|
30
|
+
"@logto/client": "^2.3.1",
|
|
31
31
|
"@silverhand/essentials": "^2.6.2",
|
|
32
32
|
"js-base64": "^3.7.4",
|
|
33
33
|
"node-fetch": "^2.6.7"
|