diff --git a/ManagerService/Startup.cs b/ManagerService/Startup.cs index 373c057..2bf8eba 100644 --- a/ManagerService/Startup.cs +++ b/ManagerService/Startup.cs @@ -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 => {