Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

74
Views
Is it possible to use Facebook clientId and clientSecret which stored in the database in passport.js Facebook Strategy

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)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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,
  },
};
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!