From 2331211899fb74d4e4a8102cd62def1352bc9e57 Mon Sep 17 00:00:00 2001 From: Mia Winter Date: Sat, 18 Nov 2023 16:54:53 +0100 Subject: [PATCH] removed: unused code (razor pages) --- Pages/Shared/_Layout.cshtml | 50 ------------------- Pages/Shared/_LoginPartial.cshtml | 6 --- Pages/Shared/_ValidationScriptsPartial.cshtml | 2 - Pages/_ViewImports.cshtml | 3 -- Pages/_ViewStart.cshtml | 3 -- Program.cs | 4 +- 6 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 Pages/Shared/_Layout.cshtml delete mode 100644 Pages/Shared/_LoginPartial.cshtml delete mode 100644 Pages/Shared/_ValidationScriptsPartial.cshtml delete mode 100644 Pages/_ViewImports.cshtml delete mode 100644 Pages/_ViewStart.cshtml diff --git a/Pages/Shared/_Layout.cshtml b/Pages/Shared/_Layout.cshtml deleted file mode 100644 index 11a627f..0000000 --- a/Pages/Shared/_Layout.cshtml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - @ViewData["Title"] - JustShortIt - - - - - - - - - - - -
- @RenderBody() -
- - - - - - @await RenderSectionAsync("Scripts", required: false) - - \ No newline at end of file diff --git a/Pages/Shared/_LoginPartial.cshtml b/Pages/Shared/_LoginPartial.cshtml deleted file mode 100644 index 19655c4..0000000 --- a/Pages/Shared/_LoginPartial.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@if (User.Identity?.IsAuthenticated is true) { - @User.Identity.Name - Logout -} else { - Login -} \ No newline at end of file diff --git a/Pages/Shared/_ValidationScriptsPartial.cshtml b/Pages/Shared/_ValidationScriptsPartial.cshtml deleted file mode 100644 index 5a16d80..0000000 --- a/Pages/Shared/_ValidationScriptsPartial.cshtml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Pages/_ViewImports.cshtml b/Pages/_ViewImports.cshtml deleted file mode 100644 index 0a27684..0000000 --- a/Pages/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using JustShortIt -@namespace JustShortIt.Pages -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/Pages/_ViewStart.cshtml b/Pages/_ViewStart.cshtml deleted file mode 100644 index a5f1004..0000000 --- a/Pages/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/Program.cs b/Program.cs index 6ad045d..e3e6e6d 100644 --- a/Program.cs +++ b/Program.cs @@ -7,7 +7,6 @@ var builder = WebApplication.CreateBuilder(args); builder.Configuration.AddEnvironmentVariables("JSI_"); -builder.Services.AddRazorPages(); builder.Services.AddAntiforgery(); builder.Services.AddRazorComponents(); @@ -53,6 +52,7 @@ options.LoginPath = "/Login"; options.LogoutPath = "/Logout"; }); +builder.Services.AddAuthorization(); builder.Services.AddScoped(); builder.Services.AddCascadingAuthenticationState(); builder.Services.AddHttpContextAccessor(); @@ -72,9 +72,7 @@ app.UseStaticFiles(); -app.UseRouting(); app.UseAuthorization(); app.UseAntiforgery(); -app.MapRazorPages(); app.MapRazorComponents(); app.Run(); \ No newline at end of file