Added Admin pages

This commit is contained in:
2024-07-21 15:08:29 +02:00
parent 7cd412b168
commit f8ee78f1fd
18 changed files with 626 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
using CurrieTechnologies.Razor.SweetAlert2;
using HopFrame.Database;
using HopFrame.Security.Authentication;
using HopFrame.Web.Services;
@@ -12,6 +13,7 @@ public static class ServiceCollectionExtensions {
services.AddHttpClient();
services.AddScoped<IAuthService, AuthService<TDbContext>>();
services.AddTransient<AuthMiddleware>();
services.AddSweetAlert2();
services.AddHopFrameAuthentication<TDbContext>();
@@ -19,6 +21,9 @@ public static class ServiceCollectionExtensions {
}
public static RazorComponentsEndpointConventionBuilder AddHopFramePages(this RazorComponentsEndpointConventionBuilder builder) {
return builder.AddAdditionalAssemblies(typeof(ServiceCollectionExtensions).Assembly);
return builder
.AddAdditionalAssemblies(typeof(ServiceCollectionExtensions).Assembly)
.AddInteractiveServerRenderMode()
.DisableAntiforgery(); //TODO: Make Antiforgery work
}
}