Closed JohanManders closed 4 months ago
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Hi @mcollina, I created a pull request (#220) for this issue. I think I found the right balance between using the key(s) and secret, hope you agree.
Prerequisites
Fastify version
4.26.2
Plugin version
7.1.0
Node.js version
14.18.1
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
Setting the option
signed: true
when initializing@fastify/secure-session
or setting the same optionsigned: true
when using thesetCookie
function, you get an error: "reply.signCookie is not a function".Example
What happens
This following happens inside the
@fastify/secure-session
index.js
file (simplyfied):Possible solution
I think one of the possible solutions could be to change from:
to something like:
Steps to Reproduce
I have set up an example project in CodeSandBox: fastify-secure-session-error-example
Expected Behavior
No response