Skip to content

Commit

Permalink
added cors rule
Browse files Browse the repository at this point in the history
  • Loading branch information
saschaheinl committed Sep 14, 2024
1 parent af6a603 commit c7225ac
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions API/TVR.Bundesliga.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
.AllowAnyMethod()
.SetIsOriginAllowed(_ => true);
});
options.AddPolicy("AllowEntryDrop",
policy =>
{
policy.WithOrigins("https://localhost:3000", "https://drop.tvr.saschahei.nl")
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.SetIsOriginAllowed(_ => true);
});
});

builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
Expand Down Expand Up @@ -208,6 +217,7 @@
if (app.Environment.IsProduction())
{
app.UseCors("Allow Ticket Smasher");
app.UseCors("AllowEntryDrop");
}

app.Run();

0 comments on commit c7225ac

Please sign in to comment.