TypeError: passport.authenticate is not a function

TypeError: passport.authenticate is not a function

每次都抛出同样的错误。我没有在护照文件中使用 createStragety。 这是我的项目回购:https://github.com/naima-shk/Twitter-Clone

我在 github 中看到了 Project Repo。您需要将 passport-jwt 放入 passport 变量并将其用于 passport.authenticate() 方法。在本节中,您应该需要针对 passport-jwt 的护照模块。因为您使用的身份验证方法属于护照库。我用这种方法测试了你的代码,它运行成功