angular-spa-security icon indicating copy to clipboard operation
angular-spa-security copied to clipboard

Page refresh security.user is null

Open michaelsogos opened this issue 10 years ago • 1 comments

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?

michaelsogos avatar Aug 11 '14 23:08 michaelsogos

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.

JustMaier avatar Aug 26 '14 17:08 JustMaier