@inherits LayoutComponentBase @using KWWebInvApp.Data @using KWWebInvApp.Services; @inject IAuthenticationService AuthenticationStateService @inject AuthenticationStateProvider AuthenticationStateProvider @inject NavigationManager navigationManager KW Web Inventory @Body @code { bool _drawerOpen = true; private UserInfoServices.userinfo? user; protected override async void OnAfterRender(bool firstRender) { base.OnAfterRender(firstRender); user = await AuthenticationStateService.GetAuthenticatedUserAsync(); } void DrawerToggle() { _drawerOpen = !_drawerOpen; } async void Logout() { var webAuthenticationStateProvider = (WebAuthenticationStateProvider)AuthenticationStateProvider; await webAuthenticationStateProvider.LogoutAsync(); navigationManager.NavigateTo("/"); } }