Update 2
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -136,5 +136,6 @@ dist
|
|||||||
.yarn/install-state.gz
|
.yarn/install-state.gz
|
||||||
.pnp.*
|
.pnp.*
|
||||||
|
|
||||||
**/bin
|
# .Net build output
|
||||||
**/obj
|
bin/
|
||||||
|
obj/
|
||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user