有一个
context
例如:
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" >
<NotAuthorized>
@if(!context.User.Identity.IsAuthenticated)
{
<p> You need Login! </p>
} else{
<p> Sorry, the content here is not for you! </p>
@*or render or component like <AccessDenied /> directly *@
}
</NotAuthorized>
<Authorizing>
<h1>Authentication in progress</h1>
<p>Only visible while authentication is in progress.</p>
</Authorizing>
</AuthorizeRouteView>