@using System.Net
@using BlazorWebAssemblyVisaApiClient.Common.Exceptions
@using VisaApiClient
@ChildContent
@code
{
[Parameter]
public RenderFragment? ChildContent { get; set; }
[Inject] private NavigationManager Nav { get; set; } = null!;
public void Handle(Exception ex)
{
if (ex is ApiException
{
StatusCode: (int)HttpStatusCode.Unauthorized or (int)HttpStatusCode.Forbidden
}
or NotLoggedInException)
{
Nav.NavigateTo("/");
}
}
}