title: why node tells me "jwt must be provided" although the token is there?
body: <p>i kinda cannot find a valid reason why i am getting that error. I am trying to build blog functionality myself for creating, commenting, liking a post in mean app using a middelware function to check if the user is authenticated. In all the activties it works fine but the like function! When i console log the token in the middleware function the token gets normally printed on the screen but the like-route dosen't identify it. Here is my Code:</p>
  
  <pre><code>router.post('/:id/like', checkToken, (req, res)=&gt;{
  console.log(req.token);// undefined
  
  jwt.verify(req.token, 'natsu1piece', (err, auth)=&gt;{
      if(err){
          console.log(err);
          res.json({err:err});
      }else { 
        User.findOne({_id:auth.id}, (err, user)=&gt;{
          if(err){
              res.json({err:err})
          }
           Post.findById(req.params.id, (err, post)=&gt;{
          if(err){
              res.json({err:err})
          }
          if(post._id===user._id){
              res.json({err:'you cannot like your own post'})
          }
          const like ={
              likerId: user._id,
              likerName: user.username
          }
          post.likes.push(like);
          post.save(err=&gt;{
              if(err){
                  res.json({err})
              }
              res.json({message: 'you liked that post'})
          })
      })
      })}
  
  })
  </code></pre>
  
  <p>})</p>
  
  <p>And here is the checkAuth middleware:</p>
  
  <pre><code>  // check authentication middleware
  function checkToken(req, res, next){
  const tokenBearer= req.headers.authorization;
  if(typeof tokenBearer !== 'undefined'){
    const bearer = tokenBearer.split(' ');
    const token = bearer[1];
    req.token = token;
    console.log(req.token) // prints the sent token successfully
  
  }
  next();
  
  }
  </code></pre>
  
  <p>i have the following function for adding a comment and it works very fine with the same middleware:</p>
  
  <pre><code>  router.post('/:id/delete-comment', checkToken, (req, res)=&gt;{
     jwt.verify(req.token, 'natsu1piece', (err, auth)=&gt;{
      if(err){
      console.log(err);
      res.json({err:err});
      return;
      }
      Post.findOneAndUpdate( {_id: req.params.id},
      {
          $pull:{
          comments:{_id:  req.body.id}
      }},
        err=&gt;{
        if(err){
          console.log(err);
          res.json({err:err});
      }
      }
  
      )
     })
     })
  </code></pre>
  
  <p>Sorry for the very long post :)</p>