diff --git a/.version b/.version index b7d89a2..dbef21c 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.17.20.29 \ No newline at end of file +0.17.20.30 \ No newline at end of file diff --git a/NetinaShop.Api/Controller/AuthController.cs b/NetinaShop.Api/Controller/AuthController.cs index a89a0f6..7c7e19b 100644 --- a/NetinaShop.Api/Controller/AuthController.cs +++ b/NetinaShop.Api/Controller/AuthController.cs @@ -29,13 +29,13 @@ public class AuthController : ICarterModule .WithDisplayName("ForgetPassword") .HasApiVersion(1.0); - group.MapPost("signup", SignUpComplex) + group.MapPost("signup", SignUpUser) .WithDisplayName("SignUp") .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser()) .HasApiVersion(1.0); } - public async Task SignUpComplex([FromBody] SignUpRequestDto request, IAccountService accountService, CancellationToken cancellationToken) => + public async Task SignUpUser([FromBody] SignUpRequestDto request, IAccountService accountService, CancellationToken cancellationToken) => TypedResults.Ok(await accountService.CompleteSignUpAsync(request, cancellationToken)); public async Task LoginWithPassword([FromBody] LoginRequestDto loginRequestDto, IAccountService accountService, CancellationToken cancellationToken) => diff --git a/NetinaShop.Api/NetinaShop.Api.csproj b/NetinaShop.Api/NetinaShop.Api.csproj index ad9311c..b1c3f25 100644 --- a/NetinaShop.Api/NetinaShop.Api.csproj +++ b/NetinaShop.Api/NetinaShop.Api.csproj @@ -6,8 +6,8 @@ enable true Linux - 0.17.20.29 - 0.17.20.29 + 0.17.20.30 + 0.17.20.30 diff --git a/NetinaShop.Api/Program.cs b/NetinaShop.Api/Program.cs index ff7ad01..c3ff869 100644 --- a/NetinaShop.Api/Program.cs +++ b/NetinaShop.Api/Program.cs @@ -23,13 +23,12 @@ builder.Services.Configure(configuration.GetSection(nameof(ShopSet // Add services to the container. builder.Services.AddControllers(); -builder.Services.AddCustomCores(); +//builder.Services.AddCustomCores(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddCustomSwagger(siteSetting!.BaseUrl); builder.Services.AddCustomApiVersioning(); builder.Services.AddCustomController(); -builder.Services.AddControllers(); builder.Services.AddCustomResponseCompression(); builder.Services.AddValidatorsFromAssembly(typeof(RepositoryConfig).Assembly, includeInternalTypes: true); builder.Services.AddCustomMvc(); @@ -102,7 +101,11 @@ if (app.Environment.IsDevelopment()) //app.UseSwagger(); //app.UseSwaggerUI(); } -app.UseCors("CorsPolicy"); +app.UseCors(x => x + .SetIsOriginAllowed(origin => true) + .AllowAnyMethod() + .AllowAnyHeader() + .AllowCredentials()); app.UseHttpsRedirection(); app.UseCustomSwagger(siteSetting.BaseUrl); diff --git a/NetinaShop.Api/WebFramework/Configurations/ServiceExtensions.cs b/NetinaShop.Api/WebFramework/Configurations/ServiceExtensions.cs index f306ed6..1c06520 100644 --- a/NetinaShop.Api/WebFramework/Configurations/ServiceExtensions.cs +++ b/NetinaShop.Api/WebFramework/Configurations/ServiceExtensions.cs @@ -94,6 +94,8 @@ public static class ServiceExtensions builder => { builder.AllowAnyMethod() + .SetPreflightMaxAge(TimeSpan.FromHours(24)) + .WithExposedHeaders("Access-control-allow-origins") .AllowAnyHeader() .SetIsOriginAllowed(_ => true) .AllowCredentials();