@jcbuisson/express-x 1.5.27 → 1.5.28

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x",
3
- "version": "1.5.27",
3
+ "version": "1.5.28",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
@@ -36,9 +36,10 @@ export async function isAuthenticated(context) {
36
36
  if (!userId) throw Error(`Not authenticated`)
37
37
  }
38
38
 
39
- export const isNotExpired = (delay) => async (context) => {
39
+ export const isNotExpired = async (context) => {
40
40
  if (context.transport !== 'ws') return
41
- const expireAt = await getConnectionDataItem(context, 'expireAt')
41
+ const expireAtISO = await getConnectionDataItem(context, 'expireAt')
42
+ const expireAt = new Date(expireAtISO)
42
43
  const now = new Date()
43
44
  if (expireAt > now) {
44
45
  // clear connection data