Implements Authorization system

This commit is contained in:
BinaryAlley committed 2024-11-22 18:02:42 +02:00
1 parent 5bfb2ca212
commit 2c9c210e43
68 files changed
+2734 -336

No files matched your search

@@ -1,4 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Common.Interceptors;
using Lumina.DataAccess.Core.UoW;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Hosting;
@@ -69,7 +70,11 @@ public class LuminaApiFactory : WebApplicationFactory<Program>, IDisposable
if (descriptor is not null)
services.Remove(descriptor);
// add SQLite DbContext configuration
services.AddDbContext<LuminaDbContext>(options => options.UseSqlite(_connection));
services.AddDbContext<LuminaDbContext>((serviceProvider, options) =>
{
options.UseSqlite(_connection);
options.AddInterceptors(serviceProvider.GetRequiredService<UpdateAuditableEntitiesInterceptor>());
});
// configure JWT authentication for testing
services.PostConfigure<JwtBearerOptions>(JwtBearerDefaults.AuthenticationScheme, options =>
{