0

I'm interacting with an interface that takes a callback which should return synchronously. However I need to perform async tasks inside this callback, using the data provided to it. This is on the server in an express app.

Interface(
   args etc,
   async (callback args) => {
      return await asyncProcess(callback args)
   }
)

I know about this thread. Is there a workaround when you don't have full control over the entirety of your app?

(The interface is the passport.js library, which I'm using for authentication in an express app. The asynchronous process is a call to a database.)

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135
zizizi
  • 31
  • 5
  • Which method in Passport.js? We're using passport in our app for auth and haven't had any issues with async functions? – coagmano Jun 03 '21 at 05:04
  • Can you please update your question so that it shows your relevant code in a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve). It would also be helpful if you could let us know what you have tried so far to solve your problem. – coagmano Jun 03 '21 at 05:26

0 Answers0