Files
Auth/Auth.API/Config/Cors.cs
T
2026-08-05 21:15:14 +03:00

41 lines
1.1 KiB
C#
Executable File

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Auth.API.Config;
public static class Cors
{
public static IServiceCollection AddCustomCors(this IServiceCollection services)
{
services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins("http://localhost:5211", "http://localhost:5055")
.AllowAnyHeader()
.AllowAnyMethod().AllowCredentials()
.WithExposedHeaders("*");
;
});
options.AddPolicy(
"default",
builder =>
{
builder
.WithOrigins("http://localhost:5211" , "http://localhost:5055")
.AllowAnyHeader()
.AllowAnyMethod().AllowCredentials()
.WithExposedHeaders("*");
;
}
);
});
return services;
}
}