Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

85
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda