Kaynağa Gözat

https://www.mtwork.com

zinab_elgendy 1 ay önce
ebeveyn
işleme
eb6fd69e62
1 değiştirilmiş dosya ile 3 ekleme ve 7 silme
  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
+);