Closed Nanosync closed 4 months ago
4.26.2
7.1.0
18.8.2
macOS
13.6.4
Modifying objects in session does not set changed to true.
session
changed
true
See passport-oauth2 - PKCESessionStore (code permalink attached)
passport-oauth2
https://github.com/jaredhanson/passport-oauth2/blob/be9bf58cee75938c645a9609f0cc87c4c724e7c8/lib/state/pkcesession.js#L48
req.session[key].state = sstate;
This line modifies an object within session, however session[key] is not proxied. Changing this value won't set changed to true.
session[key]
changed should be set to true when modifying an object/array within session.
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Prerequisites
Fastify version
4.26.2
Plugin version
7.1.0
Node.js version
18.8.2
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.6.4
Description
Modifying objects in
session
does not setchanged
totrue
.Steps to Reproduce
See
passport-oauth2
- PKCESessionStore (code permalink attached)https://github.com/jaredhanson/passport-oauth2/blob/be9bf58cee75938c645a9609f0cc87c4c724e7c8/lib/state/pkcesession.js#L48
req.session[key].state = sstate;
This line modifies an object within
session
, howeversession[key]
is not proxied. Changing this value won't setchanged
totrue
.Expected Behavior
changed
should be set totrue
when modifying an object/array withinsession
.