Closed dradovic closed 5 years ago
Indeed, that seems like a better approach. I will try it.
The ideal scenario would be to use Claims, but I don't want to invest that much time, since preview-6 will probably contain proper Auth for blazor.
I changed the sample based on your suggestions
Great!
Thanks for this nice sample!
I've noticed that the cookie inspection logic (
Authorization_LoginCookieExists
) also reports true if the user is logged in at any other ASP.NET Core Identity site that uses cookie authentication because that other site would also set a cookie.Would it be possible to instead simply try and get the user info right away as it's going to be needed anyway (and as suggested by #3)? Then, the
IsLoggedIn
method becomes a simplethis.userInfo != null
check and there would be no JS interopping. Would that make sense?