@jcbuisson/express-x 2.1.9 → 2.1.11

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": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
@@ -80,7 +80,7 @@ export const isAuthenticated = async (context) => {
80
80
  /*
81
81
  * Extend value of socket.data.expiresAt of `duration` milliseconds
82
82
  */
83
- export const extendExpiration = async (context) => (duration) => {
83
+ export const extendExpiration = (duration) => async (context) => {
84
84
  const now = new Date()
85
85
  context.socket.data.expiresAt = new Date(now.getTime() + duration)
86
86
  }
package/src/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { expressX } from './server.mjs'
3
- import { addTimestamp, hashPassword, protect, isAuthenticated, isNotExpired } from './common-hooks.mjs'
3
+ import { addTimestamp, hashPassword, protect, isAuthenticated, isNotExpired, extendExpiration } from './common-hooks.mjs'
4
4
 
5
5
  export {
6
6
  expressX,
@@ -10,4 +10,5 @@ export {
10
10
  protect,
11
11
  isAuthenticated,
12
12
  isNotExpired,
13
+ extendExpiration,
13
14
  }