@jcbuisson/express-x 1.5.29 → 1.5.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 +1 -1
- package/src/common-hooks.mjs +2 -3
- package/src/server.mjs +3 -0
package/package.json
CHANGED
package/src/common-hooks.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import config from 'config'
|
|
3
3
|
import bcrypt from 'bcryptjs'
|
|
4
4
|
|
|
5
|
-
import { getConnectionDataItem
|
|
5
|
+
import { getConnectionDataItem } from './context.mjs'
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
// hash password of user record
|
|
@@ -42,8 +42,7 @@ export const isNotExpired = async (context) => {
|
|
|
42
42
|
const expireAt = new Date(expireAtISO)
|
|
43
43
|
const now = new Date()
|
|
44
44
|
if (now > expireAt) {
|
|
45
|
-
//
|
|
46
|
-
await resetConnection(context)
|
|
45
|
+
// DON'T CLEAR CONNECTION DATA, LOGOUT WILL NOT BE ABLE TO RETRIEVE SESSIONID
|
|
47
46
|
// throw exception
|
|
48
47
|
throw new Error('session expired')
|
|
49
48
|
}
|
package/src/server.mjs
CHANGED
|
@@ -388,6 +388,9 @@ export function expressX(prisma, options = {}) {
|
|
|
388
388
|
for (const connection of connectionList) {
|
|
389
389
|
app.log('verbose', `emit to ${connection.id} ${service.name} ${action} ${result}`)
|
|
390
390
|
const socket = cnx2Socket[connection.id]
|
|
391
|
+
if (!socket) {
|
|
392
|
+
continue // SHOULD NOT HAPPEN
|
|
393
|
+
}
|
|
391
394
|
socket.emit('service-event', {
|
|
392
395
|
name: service.name,
|
|
393
396
|
action,
|