I'm trying to use passport in a typescript project. In all of the example the done callback function is called with the null value. But I get the typescript error Argument of type 'null' is not assignable to parameter of type 'string | Error | undefined'. I can make it work using done(null as any, profile);. The problem is probably with @type/passport. I googled this this problem, but didn't find anything, so I'm guessing that I did something wrong (I don't think I'm the only person using typescript with passport).
passport.use(new GoogleStrategy({
clientID: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
callbackURL: process.env.CALLBACK_URL
}, function (accessToken, refreshToken, profile, done) {
return done(null, profile);
}));