I'm using nestjs passport, currently, I have a problem while implementing this strategy. Nestjs passport expects the verified callback to be the last argument, but for this strategy, it isn't the last one, even if I set passReqToCallback = false it set an undefined in the last parameter.
I'm pretty new to passport, so I don't know if the verified callback in the last spot is something standard, but from my point of view, it seems easier to solve this issue from the strategy itself with something like this:
const verifyParams = [apiKey, verified];
if (this.passReqToCallback) verifyParams.push(req);
this.verify(...verifyParams);
I'm using nestjs passport, currently, I have a problem while implementing this strategy. Nestjs passport expects the
verified
callback to be the last argument, but for this strategy, it isn't the last one, even if I setpassReqToCallback = false
it set anundefined
in the last parameter.I'm pretty new to passport, so I don't know if the
verified
callback in the last spot is something standard, but from my point of view, it seems easier to solve this issue from the strategy itself with something like this:Replaces: https://github.com/hydra-newmedia/passport-headerapikey/blob/11fbb479e01eacbd9248167d92878ced4949b4ec/src/Strategy.ts#L62