To fix Intellij Idea warning – "Promise returned is ignored" with async/await with JavaScript, we should make sure we run the promise.
For instance, we write
await userController.login(req, res);
to call the userController.login
method that returns a promise.
And then we use await
to run the promise and wait for it to finish.