make cors origin configurable
This commit is contained in:
parent
7ab9f46e64
commit
b4edb6ae83
1 changed files with 2 additions and 1 deletions
|
@ -40,6 +40,7 @@ builder.Services.InitializeAuthenticationModule(connectionString, eventBus);
|
||||||
builder.Services.AddScoped<CurrentUserContext, CurrentUserContext>();
|
builder.Services.AddScoped<CurrentUserContext, CurrentUserContext>();
|
||||||
builder.Services.AddScoped<ICurrentUserContext>(s => s.GetRequiredService<CurrentUserContext>());
|
builder.Services.AddScoped<ICurrentUserContext>(s => s.GetRequiredService<CurrentUserContext>());
|
||||||
|
|
||||||
|
|
||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
{
|
{
|
||||||
options.AddPolicy(
|
options.AddPolicy(
|
||||||
|
@ -48,7 +49,7 @@ builder.Services.AddCors(options =>
|
||||||
{
|
{
|
||||||
b.AllowAnyHeader()
|
b.AllowAnyHeader()
|
||||||
.AllowAnyMethod()
|
.AllowAnyMethod()
|
||||||
.WithOrigins("http://localhost:5173")
|
.WithOrigins(builder.Configuration.GetValue<string>("CorsOrigins")?.Split(';') ?? [])
|
||||||
.AllowCredentials();
|
.AllowCredentials();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue