title: Intellij Idea warning - "Promise returned is ignored" with aysnc/await
body: <p>I'm using <em>Express.js</em> in my code with <em>Node.js</em> v7.3. In this I've created a <code>User Router</code> which forwards the requests to my <code>User Controller</code>.</p>
  
  <p>I'm using async/await inside the <code>User Controller</code> to do asynchronous calls. The problem is that IntelliJ gives me a warning saying that </p>
  
  <blockquote>
    <p>Promise returned from login() is ignored.</p>
  </blockquote>
  
  <p>The thing is I'm not even returning anything from the <code>login()</code> method.</p>
  
  <p>Here's the code - </p>
  
  <p><strong>UserRouter.js</strong></p>
  
  <pre><code>router.post('/login', function (req, res, next) {
      userController.login(req, res); // I get the warning here
  });
  </code></pre>
  
  <p><strong>UserController.js</strong></p>
  
  <pre><code>exports.login = async function (req, res) {
      try {
          const verifiedUser = await someFunction(req.body.access_code);
          let user = await User.findOrCreateUser(verifiedUser);
          res.status(200).send(user);
      }
      catch (err) {
          res.status(400).send({success: false, error: err});
      }
  };
  </code></pre>
  
  <p>If I write the same login method using native promises only then I don't get this warning. Am I understanding something wrong here or is IntelliJ at fault?</p>
  
  <p><strong>EDIT -</strong></p>
  
  <p>Thanks to @Stephen, I understand that an async function returns a promise but wouldn't it be better if Intellij identifies that nothing is being returned from the async function and doesn't show that warning because when I chain a <code>.then()</code> after the <code>login()</code> function, it provides an <code>undefined</code> object into the then result. It means if we don't return something from the async function explicitly then undefined is returned?</p>