@cloudron/tegel 1.1.6 → 1.2.0
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/index.js +6 -3
- package/package.json +3 -3
- package/src/oidc.js +0 -2
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import FileStoreFactory from 'session-file-store';
|
|
|
6
6
|
import { lastMile, HttpError } from '@cloudron/connect-lastmile';
|
|
7
7
|
import * as oidc from './src/oidc.js';
|
|
8
8
|
|
|
9
|
-
export async function createExpressApp({ oidcConfig, jsonBodySizeLimit = '25mb' }) {
|
|
9
|
+
export async function createExpressApp({ oidcConfig, jsonBodySizeLimit = '25mb', skipLastMile = false }) {
|
|
10
10
|
await oidc.initOIDC(oidcConfig);
|
|
11
11
|
|
|
12
12
|
const app = express();
|
|
@@ -48,7 +48,9 @@ export async function createExpressApp({ oidcConfig, jsonBodySizeLimit = '25mb'
|
|
|
48
48
|
router.del = router.delete; // amend router.del for readability further on
|
|
49
49
|
app.use(router);
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
if (!skipLastMile) {
|
|
52
|
+
app.use(lastMile());
|
|
53
|
+
}
|
|
52
54
|
|
|
53
55
|
return { app, router, express };
|
|
54
56
|
}
|
|
@@ -91,7 +93,8 @@ export function oidcCallback(successRedirectTo, errorRedirectTo, successHook = a
|
|
|
91
93
|
delete req.session.frontendOrigin; // Clean up
|
|
92
94
|
|
|
93
95
|
try {
|
|
94
|
-
const { user } = await oidc.handleCallback(req);
|
|
96
|
+
const { user, tokens } = await oidc.handleCallback(req);
|
|
97
|
+
user.accessToken = tokens.access_token;
|
|
95
98
|
|
|
96
99
|
req.session.user = user;
|
|
97
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudron/tegel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "GPL-2.0",
|
|
6
6
|
"author": "Cloudron Developers",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@eslint/js": "^10.0.1",
|
|
23
|
-
"eslint": "^10.0.
|
|
24
|
-
"globals": "^17.
|
|
23
|
+
"eslint": "^10.0.2",
|
|
24
|
+
"globals": "^17.4.0"
|
|
25
25
|
}
|
|
26
26
|
}
|