title: Angular 2, contents of subscribe never called
body: <p>I have a Spring boot backend that authenticates a user against the database and generates a JWT token for the user, now i am trying to setup the frontend with Angular 2, i have a login functions that supposed to request authentication from the backend, and save the the JWT token in localstroge, and redirect the user to  /home .</p>
  
  <pre><code>login(event, username, password) {
      event.preventDefault();
      let body = JSON.stringify({ username, password });
      this.http.post('/authenticate', body, { headers: contentHeaders })
        .subscribe(
          response =&gt; {
            localStorage.setItem('id_token', response.json().id_token);
            this.router.navigate(['home']);
          },
          error =&gt; {
            alert(error.text());
            console.log(error.text());
          }
        );
  </code></pre>
  
  <p>when a request is sent to authenticate a user, the user is authenticated and Authorization header with a valid jwt token is returned, but no redirection to /home happens, this is because code inside .subscribe() never called.
  what could possible cause this?.
  The code is part of this tutorial <a href="https://auth0.com/blog/creating-your-first-real-world-angular-2-app-from-authentication-to-calling-an-api-and-everything-in-between/" rel="nofollow noreferrer">https://auth0.com/blog/creating-your-first-real-world-angular-2-app-from-authentication-to-calling-an-api-and-everything-in-between/</a></p>