mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Added UserModel, Added Login and Logout and authorization, Made dark mode default
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user