Initial commit - Auth
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user