@inject NavigationManager Navigation
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@attribute [AllowAnonymous]

<AuthorizeView>
    <NotAuthorized>
        @{
            var returnUrl = Navigation.ToBaseRelativePath(Navigation.Uri);
            Navigation.NavigateTo($"/account/login?returnUrl={Uri.EscapeDataString(returnUrl)}", forceLoad: false);
        }
    </NotAuthorized>
    <Authorized>
        @{
            Navigation.NavigateTo("/account/access-denied");
        }
    </Authorized>
</AuthorizeView>

