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)
You will need to set top level await to true to use it in project. In your webpack config write.
module.exports = {
//...
experiments: {
topLevelAwait: true,
},
};