fastify / csrf-protection

A fastify csrf plugin.
Other
151 stars 19 forks source link

fix(types): use void as csrfProtection's return type #159

Closed ojeytonwilliams closed 4 months ago

ojeytonwilliams commented 4 months ago

Checklist

Using any as the return type for csrfProtection made it incompatible with addHook, because csrfProtection was interpreted as an async hook with 3 params, which is not allowed.

Instead void seems like the appropriate return type because the function is only invoked for its side-effects.