Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 3995

AuthenticationState HashCode changes

$
0
0

I have Blazor Application in ASP.NET Core 8.0, and I'm dealing with a problem with AuthenticationState.

I extended the AuthorizeView class and overrided OnParametersSetAsync() method to implement custom authorization logic.

In OnParametersSetAsync() method i'm accessing to the AuthenticationState through AuthenticationStateProvider instance (from Dependency injection).

If i run my application in debug i can notice that the AuthenticationState it's not always the same, It's like I have 2 instances of AuthenticationState.

protected override async Task OnParametersSetAsync(){    var hashcode = _authStateProvider.GetAuthenticationStateAsync().GetHashCode(); // Breakpoint here}

I expect the AuthenticationState hashcode is always be the same.


Viewing all articles
Browse latest Browse all 3995

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>