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

Blazor server circuits management

$
0
0

I'm trying to improve one functionality I have done some months ago to use it on another part of the project. (Blazor server)

The original functionality was for be able to logout/close the user circuit. That was accomplished by creating a singleton service (IGlobalCircuitHandlerService(singleton)) where I manage to set and remove the user circuits overriding the CircuitHandler in other service (CircuitHandlerService(scoped)). After that a hosted service (LicenseHostedService) executed every 5 min, checks if the user license is still okay and if not, marks the circuit as "bad". With that, another service AuthenticationStateValidator(scoped) extends RevalidatingServerAuthenticationStateProvider and does a fast check if the current user circuit is valid or not, and if not redirects the user to logout page (making the logout)

Thats working, maybe could be better, I haven't found a better way to do it.

Now the question, I have to do something similar to that but manually. In one component, where I show the current users and her circuits, I need to add a functionality to close user circuits. I can do that the same way as the other functionality by marking the circuit as bad and the other services will do the rest. But I'm not very satisfied with that solution. Anyone knows other ways to manage circuits and close them? Even more directly without having to wait another scoped service to catch them to redirect to logout?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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