title: How to send a token with an AJAX request from jQuery
body: <p>I use express-jwt and create my token via jQuery and save it in my localStorage with: </p>
  
  <pre><code>$.ajax({
    url: "http://localhost:8080/login",
    type: 'POST',
    data: formData,
    error : function(err) {
      console.log('Error!', err)
    },
    success: function(data) {
      console.log('Success!')
      localStorage.setItem('token', data.id_token);
    }
  });
  </code></pre>
  
  <p>I have a protected route in my backend like: </p>
  
  <pre><code>app.get('/upload',jwt({secret: config.secret}), function(req, res) {
    res.sendFile(path.join(__dirname + '/upload.html'));
  });
  </code></pre>
  
  <p><strong>How can I send the token from localStorage with the request header?</strong></p>