@using BackOffice.Shared
@using Microsoft.AspNetCore.Components.Authorization
<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(App).Assembly">
        <Found Context="routeData">
            <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
                <NotAuthorized>
                    @{
                        Task.Delay(0).ContinueWith(p =>
                        {
                            try
                            {
                                Navigation.NavigateTo(RouteConstance.Login);
                            }
                            catch
                            {
                            }
                        });
                    }
                </NotAuthorized>
            </AuthorizeRouteView>
        </Found>
        <NotFound>
            <PageTitle>یافت نشد</PageTitle>
            <LayoutView Layout="@typeof(MainLayout)">
                <p role="alert">آدرس مورد نظر یافت نشد</p> 
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>

@code{

 

}