Commit 44b1cab8 authored by hasan khaddour's avatar hasan khaddour

fix as finall

parent e8959c8b
...@@ -74,6 +74,7 @@ namespace PSManagement.Api.DI ...@@ -74,6 +74,7 @@ namespace PSManagement.Api.DI
options.AddPolicy(policy.PolicyName, options.AddPolicy(policy.PolicyName,
builder => builder builder => builder
.WithOrigins(policy.AllowedOrigins) // Add your frontend URL here .WithOrigins(policy.AllowedOrigins) // Add your frontend URL here
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader() .AllowAnyHeader()
.AllowAnyMethod() .AllowAnyMethod()
.AllowCredentials()); .AllowCredentials());
......
...@@ -14,8 +14,8 @@ namespace PSManagement.Api.Settings ...@@ -14,8 +14,8 @@ namespace PSManagement.Api.Settings
public class Policy public class Policy
{ {
public string PolicyName { get; set; } public string PolicyName { get; set; }= string.Empty;
public string AllowedOrigins { get; set; } public string AllowedOrigins { get; set; }= string.Empty;
} }
} }
...@@ -62,8 +62,9 @@ namespace PSManagement.Api ...@@ -62,8 +62,9 @@ namespace PSManagement.Api
app.UseStaticFiles(); app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.UseMyCors(); // app.UseMyCors();
app.UseCors("AllowHiast");
app.UseAuthentication(); app.UseAuthentication();
app.UseAuthorization(); app.UseAuthorization();
app.UseEndpoints(endpoints => app.UseEndpoints(endpoints =>
......
...@@ -27,7 +27,7 @@ namespace PSManagement.Presentation.Mappers ...@@ -27,7 +27,7 @@ namespace PSManagement.Presentation.Mappers
CreateMap<RemoveParticipantRequest, RemoveParticipantCommand>().ReverseMap(); CreateMap<RemoveParticipantRequest, RemoveParticipantCommand>().ReverseMap();
CreateMap<ProjectDTO, ProjectResponse>().ReverseMap(); CreateMap<ProjectDTO, ProjectResponse>().ReverseMap();
CreateMap<GetProjectsByProjectManagerRequest, GetProjectsByFilterQuery>().ConstructUsing( CreateMap<GetProjectsByProjectManagerRequest, GetProjectsByFilterQuery>().ConstructUsing(
s => new GetProjectsByFilterQuery(null, null, null, null, s.ProjectManagerId, null, null, null) s => new GetProjectsByFilterQuery(null, null, null, s.ProjectManagerId,null, null, null, null)
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment