angular-spa-security
angular-spa-security copied to clipboard
Page refresh security.user is null
Hi,
I'm using your code to integrate Angular SPA with ASP.NET MVC5 and it is very usefull.
I can't resolve a little but important issue. I can login, and everything goes well, but if i press F5 on the browser the object security.user is null. Why? :)
I'm missing something? You persist user info somewhere? I need to "re-authenticate" to get userinfo again?
A bearer token is persisted in either localStorage or sessionStorage. When the page is initialized it looks to see if it has a bearer token. If it has a bearer token it sends a request to get the user info for the owner of that token. Once it receives a response from the server it then populates security.user with the response data.