From d46f3a231585263266c3f269390586a2ead539a9 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Mon, 1 Nov 2021 08:50:07 -0500 Subject: [PATCH] Version-agnostic App component (#23699) --- .../blazor/security/includes/app-component.md | 35 ++++--------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/aspnetcore/blazor/security/includes/app-component.md b/aspnetcore/blazor/security/includes/app-component.md index 904f1c1b6b..97867075cf 100644 --- a/aspnetcore/blazor/security/includes/app-component.md +++ b/aspnetcore/blazor/security/includes/app-component.md @@ -7,32 +7,9 @@ The `App` component (`App.razor`) is similar to the `App` component found in Bla * The component makes sure that the current user is authorized to access a given page or otherwise renders the `RedirectToLogin` component. * The `RedirectToLogin` component manages redirecting unauthorized users to the login page. -```razor - - - - - - @if (!context.User.Identity.IsAuthenticated) - { - - } - else - { -

- You are not authorized to access - this resource. -

- } -
-
-
- - -

Sorry, there's nothing at this address.

-
-
-
-
-``` +Due to changes in the framework across releases of ASP.NET Core, Razor markup for the `App` component (`App.razor`) isn't shown in this section. To inspect the markup of the component for a given release, use ***either*** of the following approaches: + +* Create an app provisioned for authentication from the default Blazor WebAssembly project template for the version of ASP.NET Core that you intend to use. Inspect the `App` component (`App.razor`) in the generated app. +* Inspect the `App` component (`App.razor`) in [reference source](https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/App.razor). + + [!INCLUDE[](~/includes/aspnetcore-repo-ref-source-links.md)]