Skip to content

Commit

Permalink
Updated CORS on IDS and API
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-goldman committed Jun 28, 2023
1 parent 7b2c9ba commit b441cad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{
opt.AddPolicy("CorsPolicy", policy =>
{
policy.AllowAnyHeader().AllowAnyMethod().WithOrigins("https://localhost:7009");
policy.AllowAnyHeader().AllowAnyMethod().WithOrigins("https://localhost:7009", "https://ambitious-meadow-0ec297a00.3.azurestaticapps.net");
});
});

Expand Down
9 changes: 9 additions & 0 deletions src/Identity/HostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde

builder.Services.AddScoped<IEmailSender, EmailService>();

builder.Services.AddCors(opt =>
{
opt.AddPolicy("CorsPolicy", policy =>
{
policy.AllowAnyHeader().AllowAnyMethod().WithOrigins("https://localhost:7009", "https://ambitious-meadow-0ec297a00.3.azurestaticapps.net");
});
});

return builder.Build();
}

Expand All @@ -71,6 +79,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app)

app.UseStaticFiles();
app.UseRouting();
app.UseCors("CorsPolicy");
app.UseIdentityServer();
app.UseAuthorization();

Expand Down

0 comments on commit b441cad

Please sign in to comment.