@webqit/webflo 1.0.29 → 1.0.31

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/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "1.0.29",
15
+ "version": "1.0.31",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -6,13 +6,18 @@ export class SessionStorage extends WebfloStorage {
6
6
 
7
7
  static create(request, params = {}) {
8
8
  let sessionID = request.headers.get('Cookie', true).find((c) => c.name === '__sessid')?.value;
9
- if (sessionID?.includes('.') && params.secret) {
10
- const [rand, signature] = sessionID.split('.');
11
- const expectedSignature = crypto.createHmac('sha256', params.secret)
12
- .update(rand)
13
- .digest('hex');
14
- if (signature !== expectedSignature) {
15
- sessionID = undefined;
9
+ console.log({params});
10
+ if (sessionID?.includes('.')) {
11
+ if (params.secret) {
12
+ const [rand, signature] = sessionID.split('.');
13
+ const expectedSignature = crypto.createHmac('sha256', params.secret)
14
+ .update(rand)
15
+ .digest('hex');
16
+ if (signature !== expectedSignature) {
17
+ sessionID = undefined;
18
+ }
19
+ } else {
20
+ sessionID = null;
16
21
  }
17
22
  }
18
23
  if (!sessionID) {
@@ -191,6 +191,8 @@ export class WebfloServer extends WebfloRuntime {
191
191
  const pgClient = new pg.Pool({
192
192
  connectionString: process.env[this.#cx.server.capabilities.database_url_variable],
193
193
  database: 'postgres',
194
+ idleTimeoutMillis: 30000, // 30 seconds,
195
+ keepAlive: true
194
196
  });
195
197
  // Connect
196
198
  await pgClient.connect();