Added useless origin to cors

This commit is contained in:
Thomas Fransolet 2024-12-03 15:05:55 +01:00
parent 9ff5a7fec8
commit 05aab1bfa4

View File

@ -166,7 +166,23 @@ namespace ManagerService
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseCors("AllowAll");
//app.UseCors("AllowAll");
app.UseCors(
#if DEBUG
options => options
.SetIsOriginAllowed(origin => string.IsNullOrEmpty(origin) || origin == "http://localhost:8081")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials()
#else
options => options
.SetIsOriginAllowed(origin => string.IsNullOrEmpty(origin) || origin == "https://manager.myinfomate.be")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials()
#endif
);
app.UseEndpoints(endpoints =>
{