From 2c3131ac9ddb70adefc84efecb4f9ede0d94afe5 Mon Sep 17 00:00:00 2001 From: Nish26 Date: Sun, 21 Jan 2024 14:12:09 +0530 Subject: [PATCH 1/3] Blazor dotnet 8 migration --- .../Areas/Identity/Pages/_Layout.cshtml | 6 +++--- .../Components/App.razor | 20 +++++++++++++++++++ .../Components/Routes.razor | 9 +++++++++ src/Pixel.Identity.Provider/Startup.cs | 6 +++++- .../Views/Shared/_Layout.cshtml | 6 +++--- src/Pixel.Identity.Provider/_Imports.razor | 1 + 6 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 src/Pixel.Identity.Provider/Components/App.razor create mode 100644 src/Pixel.Identity.Provider/Components/Routes.razor diff --git a/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml b/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml index d592711..4978b84 100644 --- a/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml +++ b/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml @@ -11,12 +11,12 @@ - +
- +
@RenderBody() @@ -25,7 +25,7 @@
- + @await RenderSectionAsync("Scripts", required:false) diff --git a/src/Pixel.Identity.Provider/Components/App.razor b/src/Pixel.Identity.Provider/Components/App.razor new file mode 100644 index 0000000..983f1d4 --- /dev/null +++ b/src/Pixel.Identity.Provider/Components/App.razor @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/Pixel.Identity.Provider/Components/Routes.razor b/src/Pixel.Identity.Provider/Components/Routes.razor new file mode 100644 index 0000000..de8953c --- /dev/null +++ b/src/Pixel.Identity.Provider/Components/Routes.razor @@ -0,0 +1,9 @@ + + + + + + +

Not found

+
+
diff --git a/src/Pixel.Identity.Provider/Startup.cs b/src/Pixel.Identity.Provider/Startup.cs index d5457fa..11b1304 100644 --- a/src/Pixel.Identity.Provider/Startup.cs +++ b/src/Pixel.Identity.Provider/Startup.cs @@ -9,6 +9,7 @@ using MudBlazor.Services; using Pixel.Identity.Core; using Pixel.Identity.Core.Plugins; +using Pixel.Identity.Provider.Components; using Pixel.Identity.Provider.Extensions; using Pixel.Identity.Shared; using Quartz; @@ -63,7 +64,7 @@ public void ConfigureServices(IServiceCollection services) options.Conventions.AuthorizeAreaPage("Identity", "/Account/Register", Policies.CanManageUsers); } }); - services.AddServerSideBlazor(); + services.AddRazorComponents().AddInteractiveServerComponents(); services.AddSwaggerGen(c => { c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); @@ -146,12 +147,15 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseAuthentication(); app.UseAuthorization(); + app.UseAntiforgery(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); endpoints.MapControllers(); + endpoints.MapRazorComponents().AddInteractiveServerRenderMode(); endpoints.MapFallbackToFile("index.html"); + }); } diff --git a/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml b/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml index d5f6e80..53a8825 100644 --- a/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml +++ b/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml @@ -11,12 +11,12 @@ - +
- +
@RenderBody() @@ -25,7 +25,7 @@
- + @await RenderSectionAsync("Scripts", required:false) diff --git a/src/Pixel.Identity.Provider/_Imports.razor b/src/Pixel.Identity.Provider/_Imports.razor index 65c17d3..74e4781 100644 --- a/src/Pixel.Identity.Provider/_Imports.razor +++ b/src/Pixel.Identity.Provider/_Imports.razor @@ -7,3 +7,4 @@ @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.JSInterop @using MudBlazor; +@using Pixel.Identity.Provider.Components; From 05d6ad023d3f4b969e91ec5b732aaaf4324f5eb0 Mon Sep 17 00:00:00 2001 From: Nish26 Date: Sun, 21 Jan 2024 14:12:09 +0530 Subject: [PATCH 2/3] Blazor dotnet 8 migration --- src/Pixel.Identity.Provider/Startup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pixel.Identity.Provider/Startup.cs b/src/Pixel.Identity.Provider/Startup.cs index 11b1304..8cc83ed 100644 --- a/src/Pixel.Identity.Provider/Startup.cs +++ b/src/Pixel.Identity.Provider/Startup.cs @@ -64,7 +64,7 @@ public void ConfigureServices(IServiceCollection services) options.Conventions.AuthorizeAreaPage("Identity", "/Account/Register", Policies.CanManageUsers); } }); - services.AddRazorComponents().AddInteractiveServerComponents(); + services.AddRazorComponents(); services.AddSwaggerGen(c => { c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); @@ -153,7 +153,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { endpoints.MapRazorPages(); endpoints.MapControllers(); - endpoints.MapRazorComponents().AddInteractiveServerRenderMode(); + endpoints.MapRazorComponents(); endpoints.MapFallbackToFile("index.html"); }); From 229369569d6c0949ea8c7bfe27c6983647126de2 Mon Sep 17 00:00:00 2001 From: Nish26 Date: Sun, 21 Jan 2024 14:29:12 +0530 Subject: [PATCH 3/3] Blazor dotnet 8 migration --- .../Areas/Identity/Pages/_Layout.cshtml | 4 ++-- src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml b/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml index 4978b84..16a64ff 100644 --- a/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml +++ b/src/Pixel.Identity.Provider/Areas/Identity/Pages/_Layout.cshtml @@ -11,12 +11,12 @@ - +
- +
@RenderBody() diff --git a/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml b/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml index 53a8825..d7d7f56 100644 --- a/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml +++ b/src/Pixel.Identity.Provider/Views/Shared/_Layout.cshtml @@ -11,12 +11,12 @@ - +
- +
@RenderBody()