forked from Naveen512/Dot6.BlazorServer.Cookie.Auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.razor
25 lines (24 loc) · 881 Bytes
/
App.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@using Dot6.Bserver.Cookie.Auth.Models
@inject TokenProvider _tokenProvider;
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
@code {
[Parameter]
public ApplicationInitialState InitialState { get; set; }
protected override async Task OnInitializedAsync()
{
_tokenProvider.AntiForgeryToken = InitialState.AntiForgeryToken;
}
}