Method generateCsrf
return type should be a string
instead of FastifyReply
#124
Labels
good first issue
Good for newcomers
Prerequisites
Fastify version
4.13.0
Plugin version
6.1.0
Node.js version
18.14.2
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 22.04.2 LTS
Description
The return type of the decorated
generateCsrf
method isFastifyReply
:csrf-protection/types/index.d.ts
Lines 17 to 19 in a481954
Looking at the code, the
generateCsrf
methods returntokens.create()
which is astring
.Not a big issue as the token is almost always returned or used in
reply.send()
, but it would be nice to have the type fixed.Steps to Reproduce
Example:
The value of
typeof token
isstring
but thetoken
type (hovering in VSCode) isFastifyReply
.Expected Behavior
Return type of
generateCsrf
method should be astring
instead ofFastifyReply
.The text was updated successfully, but these errors were encountered: