When I try to use session.destroy() I get the error:
[Nest] 73846 - 02/11/2024, 9:42:58 PM ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'req')
TypeError: Cannot read properties of undefined (reading 'req')
at destroy (<>/extremepriv/privateserver/node_modules/express-session/session/session.js:110:15)
at node:internal/util:442:7
at new Promise (<anonymous>)
at destroy (node:internal/util:428:12)
at AppController.root (<>/extremepriv/privateserver/src/app.controller.ts:13:41)
The lines that are causing an error are commented out in this file, I would like to uncomment to prevent session reuse:
https://github.com/jido/extremepriv/blob/main/privateserver/src/app.controller.ts
This solution suggests to call app.use(session) before setting up the routes, how is that done in NestJS?
https://stackoverflow.com/questions/41052799/typeerror-cannot-read-property-regenerate-of-undefined
GitHub
Extreme privacy demo page. Contribute to jido/extremepriv development by creating an account on GitHub.