Added EnvelopeReceiverService to web client application.

This commit is contained in:
Developer 02
2024-06-18 11:09:13 +02:00
parent c0a6103eb2
commit cc3f6efbd7
17 changed files with 108 additions and 37 deletions

View File

@@ -36,7 +36,16 @@ var connStr = config.GetConnectionString("Default") ?? throw new InvalidOperatio
builder.Services.AddDbContext<EGDbContext>(options => options.UseSqlServer(connStr));
// Authentication
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
if (builder.Environment.IsDevelopment())
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
{
options.Cookie.HttpOnly = true;
options.LoginPath = "/api/auth/login";
options.LogoutPath = "/api/auth/logout";
});
else
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
{
options.Cookie.HttpOnly = true; // Makes the cookie inaccessible to client-side scripts for security