以下代码在开发人员(本地主机)中可以正常工作,但是当我在heroku上运行它时,它卡在了const existing = await Model.findOne({ googleId: profile.id });
行中,并且以后不打印console.log
,我可以请参见heroku logs --tail
:
passport.use(
new GoogleStrategy(
{
clientID: keys.googleClientID,
clientSecret: keys.googleClientSecret,
callbackURL: '/auth/google/callback',
},
async (accessToken, refreshToken, profile, done) => {
const existing = await Model.findOne({ googleId: profile.id });
console.log("doesn't print");
}
)
);
为什么会这样?