@cloudron/tegel 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/index.js +6 -2
  2. package/package.json +5 -4
package/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import express from 'express';
2
+ import fs from 'node:fs';
2
3
  import session from 'express-session';
4
+ import FileStoreFactory from 'session-file-store';
3
5
  import lastMile from '@cloudron/connect-lastmile';
4
6
  import { HttpError } from '@cloudron/connect-lastmile';
5
7
  import * as oidc from './src/oidc.js';
@@ -15,11 +17,13 @@ export async function createExpressApp({ sessionSecret = 'changeme', oidcConfig
15
17
 
16
18
  app.use(express.json());
17
19
 
18
- const FileStore = require('session-file-store')(session);
20
+ const FileStore = FileStoreFactory(session);
21
+ const sessionStorePath = process.env.CLOUDRON ? '/app/data/.session.store' : '/tmp/session.store';
22
+ fs.mkdirSync(sessionStorePath, { recursive: true });
19
23
 
20
24
  app.use(session({
21
25
  secret: sessionSecret,
22
- store: new FileStore({ path: process.env.CLOUDRON ? '/app/data/.session.store' : '/tmp/session.store' }),
26
+ store: new FileStore({ path: sessionStorePath }),
23
27
  resave: false,
24
28
  saveUninitialized: false,
25
29
  cookie: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudron/tegel",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "",
5
5
  "license": "GPL-2.0",
6
6
  "author": "Cloudron Developers",
@@ -15,11 +15,12 @@
15
15
  "@cloudron/connect-lastmile": "^2.3.0",
16
16
  "express": "^5.2.1",
17
17
  "express-session": "^1.19.0",
18
- "openid-client": "^6.8.1"
18
+ "openid-client": "^6.8.2",
19
+ "session-file-store": "^1.5.0"
19
20
  },
20
21
  "devDependencies": {
21
- "@eslint/js": "^9.39.2",
22
- "eslint": "^9.39.2",
22
+ "@eslint/js": "^10.0.1",
23
+ "eslint": "^10.0.0",
23
24
  "globals": "^17.3.0"
24
25
  }
25
26
  }