migrare UI in WebAssembly + integrare Serviciu stocare info pe web + WebToken

This commit is contained in:
andrei-mihnea-cerbu
2024-04-10 06:57:48 +03:00
parent 9977a9b5f5
commit adba50e70b
1915 changed files with 16113 additions and 99991 deletions
+14 -15
View File
@@ -6,6 +6,18 @@ using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder =>
{
builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.WithExposedHeaders("*"); // This exposes all headers
});
});
builder.Services.AddControllers();
builder.Services.AddInfrastructureServices(builder.Configuration);
@@ -38,33 +50,20 @@ builder.Services.AddSwaggerGen(c =>
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseCors("AllowAll");
app.UseHttpsRedirection();
//builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
// .AddJwtBearer(options =>
// {
// options.TokenValidationParameters = new TokenValidationParameters
// {
// ValidateIssuerSigningKey = true,
// IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Jwt:SecretKey"])),
// ValidateIssuer = false,
// ValidateAudience = false,
// ClockSkew = TimeSpan.Zero
// };
// });
app.MapControllers();
// Middlewares
app.UseMiddleware<ApiKeyMiddleware>();
app.UseMiddleware<BodyCheckMiddleware>();
app.UseMiddleware<JwtMiddleware>();
using (var scope = app.Services.CreateScope())
{