This commit is contained in:
P-A
2026-03-29 21:38:02 +02:00
parent bf4adb72eb
commit 7e1e44a4dc
2 changed files with 12 additions and 4 deletions

5
.gitignore vendored
View File

@@ -136,5 +136,6 @@ dist
.yarn/install-state.gz .yarn/install-state.gz
.pnp.* .pnp.*
**/bin # .Net build output
**/obj bin/
obj/

View File

@@ -30,7 +30,14 @@ builder.Services.AddCors(options =>
// ====================== // ======================
var jwtSettings = builder.Configuration.GetSection("JwtSettings"); var jwtSettings = builder.Configuration.GetSection("JwtSettings");
var key = Encoding.UTF8.GetBytes(jwtSettings["Key"]); string? secretKey = jwtSettings["Key"];
if(string.IsNullOrEmpty(secretKey))
{
return;
}
var key = Encoding.UTF8.GetBytes(secretKey);
// ====================== // ======================
// Lägg till JWT Authentication // Lägg till JWT Authentication
@@ -84,4 +91,4 @@ app.UseAuthorization();
app.MapControllers(); app.MapControllers();
app.Run(); await app.RunAsync();