@logto/express 2.2.0 → 2.3.1
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/README.md +4 -12
- package/lib/index.cjs +13 -12
- package/lib/index.js +1 -0
- package/lib/storage.d.ts +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
[](https://github.com/logto-io/js/actions/workflows/main.yml)
|
|
4
4
|
[](https://app.codecov.io/gh/logto-io/js?branch=master)
|
|
5
5
|
|
|
6
|
-
The Logto Express SDK written in TypeScript.
|
|
6
|
+
The Logto Express SDK written in TypeScript.
|
|
7
|
+
|
|
8
|
+
Check out our [docs](https://docs.logto.io/sdk/express) for more information.
|
|
7
9
|
|
|
8
10
|
## Installation
|
|
9
11
|
|
|
@@ -25,18 +27,8 @@ yarn add @logto/express
|
|
|
25
27
|
pnpm add @logto/express
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
## Get sample
|
|
29
|
-
|
|
30
|
-
A sample project can be found at [Express Sample](https://github.com/logto-io/js/tree/master/packages/express-sample)
|
|
31
|
-
|
|
32
|
-
Check out the source code and try it with ease.
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
pnpm i && pnpm start
|
|
36
|
-
```
|
|
37
|
-
|
|
38
30
|
## Resources
|
|
39
31
|
|
|
40
32
|
[](https://logto.io/)
|
|
41
|
-
[](https://docs.logto.io/
|
|
33
|
+
[](https://docs.logto.io/)
|
|
42
34
|
[](https://discord.gg/UEPaF3j5e6)
|
package/lib/index.cjs
CHANGED
|
@@ -63,57 +63,58 @@ const withLogto = (config) => async (request, response, next) => {
|
|
|
63
63
|
getAccessToken: config.getAccessToken,
|
|
64
64
|
resource: config.resource,
|
|
65
65
|
fetchUserInfo: config.fetchUserInfo,
|
|
66
|
+
getOrganizationToken: config.getOrganizationToken,
|
|
66
67
|
});
|
|
67
68
|
// eslint-disable-next-line @silverhand/fp/no-mutating-methods
|
|
68
69
|
Object.defineProperty(request, 'user', { enumerable: true, get: () => user });
|
|
69
70
|
next();
|
|
70
71
|
};
|
|
71
72
|
|
|
72
|
-
Object.defineProperty(exports,
|
|
73
|
+
Object.defineProperty(exports, "LogtoClientError", {
|
|
73
74
|
enumerable: true,
|
|
74
75
|
get: function () { return NodeClient.LogtoClientError; }
|
|
75
76
|
});
|
|
76
|
-
Object.defineProperty(exports,
|
|
77
|
+
Object.defineProperty(exports, "LogtoError", {
|
|
77
78
|
enumerable: true,
|
|
78
79
|
get: function () { return NodeClient.LogtoError; }
|
|
79
80
|
});
|
|
80
|
-
Object.defineProperty(exports,
|
|
81
|
+
Object.defineProperty(exports, "LogtoRequestError", {
|
|
81
82
|
enumerable: true,
|
|
82
83
|
get: function () { return NodeClient.LogtoRequestError; }
|
|
83
84
|
});
|
|
84
|
-
Object.defineProperty(exports,
|
|
85
|
+
Object.defineProperty(exports, "OidcError", {
|
|
85
86
|
enumerable: true,
|
|
86
87
|
get: function () { return NodeClient.OidcError; }
|
|
87
88
|
});
|
|
88
|
-
Object.defineProperty(exports,
|
|
89
|
+
Object.defineProperty(exports, "PersistKey", {
|
|
89
90
|
enumerable: true,
|
|
90
91
|
get: function () { return NodeClient.PersistKey; }
|
|
91
92
|
});
|
|
92
|
-
Object.defineProperty(exports,
|
|
93
|
+
Object.defineProperty(exports, "Prompt", {
|
|
93
94
|
enumerable: true,
|
|
94
95
|
get: function () { return NodeClient.Prompt; }
|
|
95
96
|
});
|
|
96
|
-
Object.defineProperty(exports,
|
|
97
|
+
Object.defineProperty(exports, "ReservedResource", {
|
|
97
98
|
enumerable: true,
|
|
98
99
|
get: function () { return NodeClient.ReservedResource; }
|
|
99
100
|
});
|
|
100
|
-
Object.defineProperty(exports,
|
|
101
|
+
Object.defineProperty(exports, "ReservedScope", {
|
|
101
102
|
enumerable: true,
|
|
102
103
|
get: function () { return NodeClient.ReservedScope; }
|
|
103
104
|
});
|
|
104
|
-
Object.defineProperty(exports,
|
|
105
|
+
Object.defineProperty(exports, "UserScope", {
|
|
105
106
|
enumerable: true,
|
|
106
107
|
get: function () { return NodeClient.UserScope; }
|
|
107
108
|
});
|
|
108
|
-
Object.defineProperty(exports,
|
|
109
|
+
Object.defineProperty(exports, "buildOrganizationUrn", {
|
|
109
110
|
enumerable: true,
|
|
110
111
|
get: function () { return NodeClient.buildOrganizationUrn; }
|
|
111
112
|
});
|
|
112
|
-
Object.defineProperty(exports,
|
|
113
|
+
Object.defineProperty(exports, "getOrganizationIdFromUrn", {
|
|
113
114
|
enumerable: true,
|
|
114
115
|
get: function () { return NodeClient.getOrganizationIdFromUrn; }
|
|
115
116
|
});
|
|
116
|
-
Object.defineProperty(exports,
|
|
117
|
+
Object.defineProperty(exports, "organizationUrnPrefix", {
|
|
117
118
|
enumerable: true,
|
|
118
119
|
get: function () { return NodeClient.organizationUrnPrefix; }
|
|
119
120
|
});
|
package/lib/index.js
CHANGED
|
@@ -58,6 +58,7 @@ const withLogto = (config) => async (request, response, next) => {
|
|
|
58
58
|
getAccessToken: config.getAccessToken,
|
|
59
59
|
resource: config.resource,
|
|
60
60
|
fetchUserInfo: config.fetchUserInfo,
|
|
61
|
+
getOrganizationToken: config.getOrganizationToken,
|
|
61
62
|
});
|
|
62
63
|
// eslint-disable-next-line @silverhand/fp/no-mutating-methods
|
|
63
64
|
Object.defineProperty(request, 'user', { enumerable: true, get: () => user });
|
package/lib/storage.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/express",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"directory": "packages/express"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@logto/node": "^2.
|
|
24
|
+
"@logto/node": "^2.4.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@silverhand/eslint-config": "^
|
|
28
|
-
"@silverhand/ts-config": "^
|
|
29
|
-
"@silverhand/ts-config-react": "^
|
|
27
|
+
"@silverhand/eslint-config": "^5.0.0",
|
|
28
|
+
"@silverhand/ts-config": "^5.0.0",
|
|
29
|
+
"@silverhand/ts-config-react": "^5.0.0",
|
|
30
30
|
"@swc/core": "^1.3.50",
|
|
31
31
|
"@swc/jest": "^0.2.24",
|
|
32
32
|
"@types/cookie-parser": "^1.4.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"lint-staged": "^15.0.0",
|
|
45
45
|
"prettier": "^3.0.0",
|
|
46
46
|
"supertest": "^6.3.3",
|
|
47
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.3.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"express": ">=4"
|