OnProfNext/OnProfNext.Client/Shared/RedirectToLogin.razor
2025-10-14 12:57:40 +02:00

17 lines
426 B
Plaintext

@inject NavigationManager Nav
@inject OnProfNext.Client.Services.AuthService AuthService
@code {
protected override async Task OnInitializedAsync()
{
var loggedIn = await AuthService.IsLoggedInAsync();
if (!loggedIn)
{
Nav.NavigateTo("/login", forceLoad: true);
}
else
{
Nav.NavigateTo("/", forceLoad: true);
}
}
}