@using WebApp.Components.Layout
@inject NavigationManager navigationManager

<Router AppAssembly="typeof(Program).Assembly">
    <Found Context="routeData">
        <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
            <NotAuthorized>
                @{
                    navigationManager.NavigateTo("/login", true);
                }
            </NotAuthorized>
        </AuthorizeRouteView>
        <FocusOnNavigate RouteData="@routeData" Selector="h1"/>
    </Found>
    <NotFound>
        @{
            navigationManager.NavigateTo("/login", true);
        }
    </NotFound>
</Router>