createStratergy 是一个函数吗?

问题描述

passport.use(User.createStrategy());
                  ^

TypeError: User.createStrategy is not a function

我不知道 docs 是否有 repo 有它.. 但即使在安装最新的护照包并导入它们之后我也得到了它。

解决方法

您是否从 User 类中导出 createStrategy 函数?一般来说,passport.use 将有两个参数(名称、策略)。此策略将基于您使用的 idp。