forked from MDCPS/DamageAssessment_Backend
		
	Updated CORS statements Policy
This commit is contained in:
		| @ -9,9 +9,12 @@ using System.Reflection; | ||||
| using System.Text; | ||||
|  | ||||
| var builder = WebApplication.CreateBuilder(args); | ||||
|  | ||||
| builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => { | ||||
|     build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin(); | ||||
| })); | ||||
| // Add services to the container. | ||||
| var authkey = builder.Configuration.GetValue<string>("JwtSettings:securitykey"); | ||||
|  | ||||
| builder.Services.AddAuthentication(item => | ||||
| { | ||||
|     item.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | ||||
| @ -96,7 +99,7 @@ if (app.Environment.IsDevelopment()) | ||||
|         regionProvider.SeedData(); | ||||
|     } | ||||
| } | ||||
|  | ||||
| app.UseCors("DamageAppCorsPolicy"); | ||||
| app.UseAuthentication(); | ||||
| app.UseAuthorization(); | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user