Update 2
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -136,5 +136,6 @@ dist
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
**/bin
|
||||
**/obj
|
||||
# .Net build output
|
||||
bin/
|
||||
obj/
|
||||
@@ -30,7 +30,14 @@ builder.Services.AddCors(options =>
|
||||
// ======================
|
||||
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
|
||||
@@ -84,4 +91,4 @@ app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
await app.RunAsync();
|
||||
|
||||
Reference in New Issue
Block a user