fastify-secure-session icon indicating copy to clipboard operation
fastify-secure-session copied to clipboard

changed value should be set to true when modifying objects within session

Open Nanosync opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

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 set changed to true.

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, however session[key] is not proxied. Changing this value won't set changed to true.

Expected Behavior

changed should be set to true when modifying an object/array within session.

Nanosync avatar Mar 22 '24 08:03 Nanosync

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

mcollina avatar Mar 22 '24 08:03 mcollina