This commit is contained in:
Michał Zieliński
2023-11-12 14:41:44 +01:00
parent f44094dc29
commit 3a8fa60aea

View File

@@ -45,12 +45,11 @@ builder.Services.AddAuthentication(options =>
ValidateAudience = false,
ValidateLifetime = true,
ValidateIssuerSigningKey = true,
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Secret"]))
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Secret"]!))
};
});
builder.Services.AddAuthorization();
builder.Services.AddAuthentication();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
@@ -82,7 +81,7 @@ if (app.Environment.IsDevelopment())
// app.UseHttpsRedirection();
app.UseCors("CORSPolicy");
app.UseAuthorization();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();