@cloudron/tegel 1.1.7 → 1.2.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/index.js +11 -3
- package/package.json +3 -3
- package/src/oidc.js +0 -2
package/index.js
CHANGED
|
@@ -6,8 +6,8 @@ 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' }) {
|
|
10
|
-
await oidc.initOIDC(oidcConfig);
|
|
9
|
+
export async function createExpressApp({ oidcConfig, jsonBodySizeLimit = '25mb', skipLastMile = false }) {
|
|
10
|
+
if (oidcConfig) await oidc.initOIDC(oidcConfig);
|
|
11
11
|
|
|
12
12
|
const app = express();
|
|
13
13
|
|
|
@@ -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
|
}
|
|
@@ -128,6 +130,12 @@ export function logout(redirectTo) {
|
|
|
128
130
|
|
|
129
131
|
req.session.destroy((error) => {
|
|
130
132
|
if (error) console.error('Logout error:', error);
|
|
133
|
+
res.clearCookie('connect.sid', {
|
|
134
|
+
path: '/',
|
|
135
|
+
httpOnly: true,
|
|
136
|
+
secure: process.env.NODE_ENV === 'production',
|
|
137
|
+
sameSite: 'lax'
|
|
138
|
+
});
|
|
131
139
|
res.redirect(redirectUri + redirectTo);
|
|
132
140
|
});
|
|
133
141
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudron/tegel",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
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.3",
|
|
24
|
+
"globals": "^17.4.0"
|
|
25
25
|
}
|
|
26
26
|
}
|