diff --git a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/App.razor b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/App.razor index d07039a5..36912bb8 100644 --- a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/App.razor +++ b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/App.razor @@ -1,25 +1,12 @@ - - - - - - @if (context.User.Identity?.IsAuthenticated != true) - { - - } - else - { -

You are not authorized to access this resource.

- } -
-
- -
- - Not found - -

Sorry, there's nothing at this address.

-
-
-
-
+ + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
diff --git a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/EqDemo.BlazorWasm.AdhocReporting.Client.csproj b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/EqDemo.BlazorWasm.AdhocReporting.Client.csproj index 757d9614..f93db97e 100644 --- a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/EqDemo.BlazorWasm.AdhocReporting.Client.csproj +++ b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/EqDemo.BlazorWasm.AdhocReporting.Client.csproj @@ -1,18 +1,17 @@  - net6.0 + net8.0 EqDemo.Client enable enable - - - - - + + + + diff --git a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Authentication.razor b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Authentication.razor index 6c743567..7d221ef3 100644 --- a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Authentication.razor +++ b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Authentication.razor @@ -1,6 +1,6 @@ -@page "/authentication/{action}" -@using Microsoft.AspNetCore.Components.WebAssembly.Authentication - +@page "/authentication/{action}" + +

Authentication is not configured.

@code{ [Parameter] public string? Action { get; set; } diff --git a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/FetchData.razor b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/FetchData.razor index 5ba2a5eb..d78abebb 100644 --- a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/FetchData.razor +++ b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/FetchData.razor @@ -1,8 +1,5 @@ -@page "/fetchdata" -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Components.WebAssembly.Authentication +@page "/fetchdata" @using EqDemo.Shared -@attribute [Authorize] @inject HttpClient Http Weather forecast @@ -45,13 +42,6 @@ else protected override async Task OnInitializedAsync() { - try - { - forecasts = await Http.GetFromJsonAsync("WeatherForecast"); - } - catch (AccessTokenNotAvailableException exception) - { - exception.Redirect(); - } + forecasts = await Http.GetFromJsonAsync("WeatherForecast"); } } diff --git a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Reports.razor b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Reports.razor index ac5ce0a1..3aee8b09 100644 --- a/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Reports.razor +++ b/AspNetCore/Blazor/AdHocReporting.BlazorWasm/Client/Pages/Reports.razor @@ -1,14 +1,8 @@ -@page "/reports" -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Components.WebAssembly.Authentication -@using Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal -@attribute [Authorize] +@page "/reports" @implements IAsyncDisposable @inject IJSRuntime JSRuntime @inject NavigationManager NavigationManager -@inject AuthenticationStateProvider AuthenticationStateProvider -@inject IAccessTokenProviderAccessor AccessTokenProviderAccessor