diff --git a/src/AuthenticationWithClientSideBlazor.Client/ApiAuthenticationStateProvider.cs b/src/AuthenticationWithClientSideBlazor.Client/ApiAuthenticationStateProvider.cs index 1eea73d..0028800 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/ApiAuthenticationStateProvider.cs +++ b/src/AuthenticationWithClientSideBlazor.Client/ApiAuthenticationStateProvider.cs @@ -1,5 +1,4 @@ using Blazored.LocalStorage; -using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; using System.Linq; @@ -8,6 +7,7 @@ using System.Security.Claims; using System.Text.Json; using System.Threading.Tasks; +using Microsoft.AspNetCore.Components.Authorization; namespace AuthenticationWithClientSideBlazor.Client { diff --git a/src/AuthenticationWithClientSideBlazor.Client/App.razor b/src/AuthenticationWithClientSideBlazor.Client/App.razor index 552324e..c8ed603 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/App.razor +++ b/src/AuthenticationWithClientSideBlazor.Client/App.razor @@ -1,7 +1,11 @@ - - - - Sorry, there's nothing at this address. - - - \ No newline at end of file + + + + + + + Page not found + Sorry, but there's nothing here! + + + diff --git a/src/AuthenticationWithClientSideBlazor.Client/AuthenticationWithClientSideBlazor.Client.csproj b/src/AuthenticationWithClientSideBlazor.Client/AuthenticationWithClientSideBlazor.Client.csproj index a223add..d759e03 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/AuthenticationWithClientSideBlazor.Client.csproj +++ b/src/AuthenticationWithClientSideBlazor.Client/AuthenticationWithClientSideBlazor.Client.csproj @@ -8,10 +8,11 @@ - - - - + + + + + diff --git a/src/AuthenticationWithClientSideBlazor.Client/Pages/Login.razor b/src/AuthenticationWithClientSideBlazor.Client/Pages/Login.razor index aa9468c..8e3ca8a 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/Pages/Login.razor +++ b/src/AuthenticationWithClientSideBlazor.Client/Pages/Login.razor @@ -1,6 +1,6 @@ @page "/login" @inject IAuthService AuthService -@inject IUriHelper UriHelper +@inject NavigationManager UriHelper Login diff --git a/src/AuthenticationWithClientSideBlazor.Client/Pages/Logout.razor b/src/AuthenticationWithClientSideBlazor.Client/Pages/Logout.razor index 263c084..96dcdd3 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/Pages/Logout.razor +++ b/src/AuthenticationWithClientSideBlazor.Client/Pages/Logout.razor @@ -1,6 +1,6 @@ @page "/logout" @inject IAuthService AuthService -@inject IUriHelper UriHelper +@inject NavigationManager UriHelper @code { diff --git a/src/AuthenticationWithClientSideBlazor.Client/Pages/Register.razor b/src/AuthenticationWithClientSideBlazor.Client/Pages/Register.razor index 98adf96..1e1b417 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/Pages/Register.razor +++ b/src/AuthenticationWithClientSideBlazor.Client/Pages/Register.razor @@ -1,6 +1,6 @@ @page "/register" @inject IAuthService AuthService -@inject IUriHelper UriHelper +@inject NavigationManager UriHelper Register diff --git a/src/AuthenticationWithClientSideBlazor.Client/Pages/_Imports.razor b/src/AuthenticationWithClientSideBlazor.Client/Pages/_Imports.razor deleted file mode 100644 index 0f24eda..0000000 --- a/src/AuthenticationWithClientSideBlazor.Client/Pages/_Imports.razor +++ /dev/null @@ -1 +0,0 @@ -@layout MainLayout diff --git a/src/AuthenticationWithClientSideBlazor.Client/Services/AuthService.cs b/src/AuthenticationWithClientSideBlazor.Client/Services/AuthService.cs index a83f5d1..ece0a4f 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/Services/AuthService.cs +++ b/src/AuthenticationWithClientSideBlazor.Client/Services/AuthService.cs @@ -1,6 +1,7 @@ using AuthenticationWithClientSideBlazor.Shared; using Blazored.LocalStorage; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Authorization; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; diff --git a/src/AuthenticationWithClientSideBlazor.Client/Shared/SurveyPrompt.razor b/src/AuthenticationWithClientSideBlazor.Client/Shared/SurveyPrompt.razor index a126a15..f399ba4 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/Shared/SurveyPrompt.razor +++ b/src/AuthenticationWithClientSideBlazor.Client/Shared/SurveyPrompt.razor @@ -11,5 +11,5 @@ @code { // Demonstrates how a parent component can supply parameters - [Parameter] string Title { get; set; } + [Parameter] public string Title { get; set; } } diff --git a/src/AuthenticationWithClientSideBlazor.Client/Startup.cs b/src/AuthenticationWithClientSideBlazor.Client/Startup.cs index 8639df1..67d0a51 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/Startup.cs +++ b/src/AuthenticationWithClientSideBlazor.Client/Startup.cs @@ -1,6 +1,7 @@ using AuthenticationWithClientSideBlazor.Client.Services; using Blazored.LocalStorage; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Builder; using Microsoft.Extensions.DependencyInjection; diff --git a/src/AuthenticationWithClientSideBlazor.Client/_Imports.razor b/src/AuthenticationWithClientSideBlazor.Client/_Imports.razor index e3b1cab..bfed6a5 100644 --- a/src/AuthenticationWithClientSideBlazor.Client/_Imports.razor +++ b/src/AuthenticationWithClientSideBlazor.Client/_Imports.razor @@ -1,6 +1,9 @@ @using System.Net.Http +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web @using Microsoft.JSInterop @using AuthenticationWithClientSideBlazor.Shared @using AuthenticationWithClientSideBlazor.Client diff --git a/src/AuthenticationWithClientSideBlazor.Server/AuthenticationWithClientSideBlazor.Server.csproj b/src/AuthenticationWithClientSideBlazor.Server/AuthenticationWithClientSideBlazor.Server.csproj index 0585115..84ffb88 100644 --- a/src/AuthenticationWithClientSideBlazor.Server/AuthenticationWithClientSideBlazor.Server.csproj +++ b/src/AuthenticationWithClientSideBlazor.Server/AuthenticationWithClientSideBlazor.Server.csproj @@ -6,17 +6,20 @@ - - + + - - - - - - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/src/AuthenticationWithClientSideBlazor.Server/appsettings.json b/src/AuthenticationWithClientSideBlazor.Server/appsettings.json index c84bafb..8d34802 100644 --- a/src/AuthenticationWithClientSideBlazor.Server/appsettings.json +++ b/src/AuthenticationWithClientSideBlazor.Server/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=AuthenticationWithClientSideBlazor;Trusted_Connection=True;MultipleActiveResultSets=true" + "DefaultConnection": "server=localhost\\SQLEXPRESS;Trusted_Connection=True;Database=AuthenticationWithClientSideBlazor;" }, "JwtSecurityKey": "RANDOM_KEY_MUST_NOT_BE_SHARED", "JwtIssuer": "https://localhost", diff --git a/src/AuthenticationWithClientSideBlazor.Shared/AuthenticationWithClientSideBlazor.Shared.csproj b/src/AuthenticationWithClientSideBlazor.Shared/AuthenticationWithClientSideBlazor.Shared.csproj index 75617be..ead800b 100644 --- a/src/AuthenticationWithClientSideBlazor.Shared/AuthenticationWithClientSideBlazor.Shared.csproj +++ b/src/AuthenticationWithClientSideBlazor.Shared/AuthenticationWithClientSideBlazor.Shared.csproj @@ -6,7 +6,7 @@ - +
Sorry, there's nothing at this address.
Sorry, but there's nothing here!