Closed AaronPorts closed 3 years ago
I think you need to pass that callback function to the the authenticate handler, not to the route registration. There's two different functions: one passed to authenticate
, and one passed to the fastify route that deals with the actual request / response once the authentication handler has run. See the readme! Try that out and feel free to reopen if you still can't get it to work. Also, a better place for issues like this is probably fastify/help!
Prerequisites
Fastify version
3.19.2
Plugin version
0.4.3
Node.js version
16.2.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
Callback in
fastifyPassport.authenticate
function does not trigger if authorization is incorrect, and has onlyrequest, reply
parameters in case of success authorization.Steps to Reproduce
Expected Behavior
The callback function is triggered on any request