[X] I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.23.2
Plugin version
6.4.0
Node.js version
20.9.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.1
Description
Hi, when using typescript and trying to register the csrf-protection plugin, i get a compiler error because csrfOpts.hmacKey is not defined even though on the docs and on the javascript code that property is required only if the sessionPlugin is fastify/cookie and csrfOpts.userInfo is truthy.
if (sessionPlugin === '@fastify/cookie' && csrfOpts.userInfo) {
assert(csrfOpts.hmacKey, 'csrfOpts.hmacKey is required')
}
Prerequisites
Fastify version
4.23.2
Plugin version
6.4.0
Node.js version
20.9.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.1
Description
Hi, when using typescript and trying to register the csrf-protection plugin, i get a compiler error because csrfOpts.hmacKey is not defined even though on the docs and on the javascript code that property is required only if the sessionPlugin is fastify/cookie and csrfOpts.userInfo is truthy.
Steps to Reproduce
Expected Behavior
I would expect to be able to register the plugin without any compiler errors.