Added UserModel, Added Login and Logout and authorization, Made dark mode default

This commit is contained in:
2025-09-29 21:51:32 +02:00
parent 11c37376ad
commit 5c633bd17c
11 changed files with 246 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
using ElmahCore;
using ElmahCore.Mvc;
using Serilog;
using Microsoft.AspNetCore.Authentication.Cookies;
using Berufsschule_HAM.Services;
var builder = WebApplication.CreateBuilder(args);
@@ -26,6 +27,14 @@ builder.Services.AddElmah<XmlFileErrorLog>(Options =>
builder.Services.AddSingleton<LdapService>();
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
{
options.LoginPath = "/Home/Login";
options.LogoutPath = "/Home/Login/Logout";
options.AccessDeniedPath = "/Home/AccessDenied";
});
var app = builder.Build();
if (!app.Environment.IsDevelopment())