是否可以使用Facebook ClientId和客户端封存,该端口存储在Passport.js Facebook策略中的数据库中
我正在尝试使用存储在数据库中的Facebook clientId和clientsecret,
这是我的代码
passport.use(
new FacebookStrategy(
{
clientID:
process.env.AUTH_FACEBOOK_CLIENT_ID ||
await getStringConfig('auth', `facebook_client_id`),
clientSecret:
process.env.AUTH_FACEBOOK_CLIENT_SECRET ||
await getStringConfig('auth', `facebook_client_secret`),
callbackURL: WEBSITE_URL + '/api/auth/social/facebook/callback',
profileFields: ['languages', 'email'],
passReqToCallback: true,
},
function (req, accessToken, refreshToken, profile, done) {
socialAuthCallback(
req as unknown as NextApiRequest,
'facebook',
profile,
done
)
}
)
)
getsTringConfig
函数返回诺言,我知道代码不正确,但是
当我运行时, 该问题是否有任何解决方案我收到此错误的代码
错误:未启用顶级 - 怀特实验(SET EXPERMENTS.TOPLEVELAWAIT:TRUE启用启用))
I'm trying to use the Facebook clientId and clientSecret which stored in the database
this is my code
passport.use(
new FacebookStrategy(
{
clientID:
process.env.AUTH_FACEBOOK_CLIENT_ID ||
await getStringConfig('auth', `facebook_client_id`),
clientSecret:
process.env.AUTH_FACEBOOK_CLIENT_SECRET ||
await getStringConfig('auth', `facebook_client_secret`),
callbackURL: WEBSITE_URL + '/api/auth/social/facebook/callback',
profileFields: ['languages', 'email'],
passReqToCallback: true,
},
function (req, accessToken, refreshToken, profile, done) {
socialAuthCallback(
req as unknown as NextApiRequest,
'facebook',
profile,
done
)
}
)
)
getStringConfig
function returns a promise I know the code is not correct but is there any solution for this problem
when I run the code I got this error
Error: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要设置最高水平等待在项目中使用它。在您的WebPack配置中写。
You will need to set top level await to true to use it in project. In your webpack config write.