Browse Source

https://www.mtwork.com

zinab_elgendy 1 month ago
parent
commit
eb6fd69e62
1 changed files with 3 additions and 7 deletions
  1. 3 7
      MTWorkHR.API/Program.cs

+ 3 - 7
MTWorkHR.API/Program.cs

@@ -174,15 +174,11 @@ app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MTWorkHR.AP
 app.UseRouting();  // <-- Add UseRouting() here
 
 app.UseCors(x => x
-    .WithOrigins("https://api.mtwork.com", "https://mtworkhrclient.azurewebsites.net", "http://localhost:4200/") // Allowed origin
+    .WithOrigins("https://api.mtwork.com", "https://mtworkhrclient.azurewebsites.net", "http://localhost:4200", "https://www.mtwork.com") // Allowed origins without trailing slash
     .AllowAnyMethod()
     .AllowAnyHeader()
-    .SetIsOriginAllowed(origin =>
-    true) // allow any origin
-    .AllowCredentials()); // allow credentials
-
-
-
+    .AllowCredentials() // Allows credentials
+);