diff --git a/Backend/src/FlowTasks.API/Program.cs b/Backend/src/FlowTasks.API/Program.cs index f66bfe0..a290b5b 100644 --- a/Backend/src/FlowTasks.API/Program.cs +++ b/Backend/src/FlowTasks.API/Program.cs @@ -88,9 +88,13 @@ .AddDbContextCheck(name: "ApplicationDbContext Check"); // JWT Authentication -var jwtKey = builder.Configuration["JwtKey"] ?? throw new InvalidOperationException("JWT Key not configured"); -var jwtIssuer = builder.Configuration["Jwt:Issuer"] ?? "FlowTasks"; -var jwtAudience = builder.Configuration["Jwt:Audience"] ?? "FlowTasks"; +var jwtKey = builder.Configuration["Jwt:Key"] ?? throw new InvalidOperationException("JWT Key not configured"); +var jwtIssuer = builder.Configuration["Jwt:Issuer"] ?? throw new InvalidOperationException("JWT Issuer not configured"); +var jwtAudience = builder.Configuration["Jwt:Audience"] ?? throw new InvalidOperationException("JWT Audience not configured"); +if (string.IsNullOrWhiteSpace(jwtKey)) +{ + Log.Error("jwt Key est vide ou manquante dans la configuration !"); +} builder.Services.AddAuthentication(options => { @@ -114,6 +118,10 @@ builder.Services.AddAuthorization(); var UrlFrontend = builder.Configuration["UrlFrontend"]; +if (string.IsNullOrWhiteSpace(UrlFrontend)) +{ + Log.Error("UrlFrontend est vide ou manquante dans la configuration !"); +} // CORS configuration builder.Services.AddCors(options => { diff --git a/Backend/src/FlowTasks.API/appsettings.Development.json b/Backend/src/FlowTasks.API/appsettings.Development.json index 1047a9a..ebb7850 100644 --- a/Backend/src/FlowTasks.API/appsettings.Development.json +++ b/Backend/src/FlowTasks.API/appsettings.Development.json @@ -5,6 +5,15 @@ "Microsoft.AspNetCore": "Information", "Microsoft.EntityFrameworkCore": "Information" } - } + }, + "ConnectionStrings": { + "DefaultConnection": "" + }, + "Jwt": { + "Key": "", + "Issuer": "FlowTasks", + "Audience": "FlowTasks" + }, + "UrlFrontend": "" } diff --git a/Backend/src/FlowTasks.API/appsettings.json b/Backend/src/FlowTasks.API/appsettings.json index be15dc1..4de73c4 100644 --- a/Backend/src/FlowTasks.API/appsettings.json +++ b/Backend/src/FlowTasks.API/appsettings.json @@ -14,6 +14,7 @@ "Key": "", "Issuer": "FlowTasks", "Audience": "FlowTasks" - } + }, + "UrlFrontend" : "" }