@using ImageBoardServerApp.Auth
@using ImageBoardServerApp.Data.Repository
@inject AuthenticationStateProvider authStateProvider
@inject NavigationManager navManager
@code {
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
}
private async Task logout()
{
var customAuthStateProvider = (CustomAuthenticationStateProvider) authStateProvider;
await customAuthStateProvider.UpdateAuthenticationStateAsync(null);
navManager.NavigateTo("/", true);
}
public List boards { get; set; }
protected override async Task OnInitializedAsync()
{
boards = await BoardsRepository.getBoardsAsync();
}
}