Angular2 + Web API + token based authentication
<p>I am trying to learn Angular2</p>

<p>and I am trying to create a simple blog with authentication.</p>

<p>this here is my add a new post method:</p>

<pre><code>    [Authorize]
    // POST: api/Post
    public PostModel Post([FromBody]PostViewModel model)
    {             
        var post = new PostModel
        {
            Body = model.Body,
            Title = model.Title,
            AuthorId = IdentityExtensions.GetUserId(User.Identity),
        };
        var res = blogRepo.AddPost(post);
        return res;                 
    }
</code></pre>

<p>everything works fine, but <code>IdentityExtension.GetUserId()</code> do not return the most current logged in user but the first user since the app started.</p>

<p>basically I am looking for a way to make sure that the current user logs out on the server as well as on the client (the client side is just a simple removal of the <code>localStorage.removeItem("jwt");</code>)</p>

<p>also there is a good chance that what I am doing is totally wrong, but I can't access the <code>ApplicationUserManager</code> in this controller.</p>