title: Can't get user login info in postman
body: <p>I'm creating a REST API using <code>Node js</code> and <code>expressJs</code>, but suddenly I have faced a problem when I tried to create a user then I can create it like this way:</p>
  <pre><code>/**
   * save user data from the user model
   */
  
  router.post(&quot;/users&quot;, async (req, res) =&gt; {
    const user = new User(req.body);
  
    try {
      await user.save();
      res.status(201).send( user);
    } catch (e) {
      res.status(400).send(e);
    }
  });
  </code></pre>
  <p>after creating a user I can see a response in postman.</p>
  <p>But When I tried to go <code>/users/login</code> routes then I have faced a problem it shows me <code>400 bad requests</code> also can't get any response. here is my code:</p>
  <pre><code>/**
   * User login.
   */
  
  router.post(&quot;/users/login&quot;, async (req, res) =&gt; {
    try {
      const user = await User.findByCredentials(
        req.body.email,
        req.body.password
      );
      res.send( user);
    } catch (e) {
      res.status(400).send();
    }
  });
  </code></pre>
  <pre><code>/**
   * user login crendentials
   */
  
  userSchema.statics.findByCredentials = async (email, password) =&gt; {
    const user = await User.findOne({ email });
  
    if (!user) {
      throw new Error(&quot;Unable to login&quot;);
    }
  
    const isMatch = await bcrypt.compare(password, user.password);
  
    if (!isMatch) {
      throw new Error(&quot;Unable to login&quot;);
    }
    
  };
  </code></pre>
  <p>Any suggestion will highly appreciated
  Thanks.</p>