Updated cors policy

This commit is contained in:
2023-08-13 20:36:50 -04:00
parent 5983447e20
commit 080f812636

View File

@ -127,8 +127,8 @@ namespace IO.Swagger
{
po.AllowAnyHeader()
.WithMethods("GET", "POST")
.WithOrigins("http://localhost:*", "https://localhost:*", "http://*.shrukanslab.xyz", "https://*.shrukanslab.xyz")
.SetIsOriginAllowedToAllowWildcardSubdomains();
po.SetIsOriginAllowed((or) => or.Contains("localhost") || or.Contains("shrukanslab"));
});
});
@ -140,6 +140,7 @@ namespace IO.Swagger
}
Console.WriteLine(connectionString);
services.AddScoped<IUserRepository, UserRepository>();
services.AddScoped<ICurrencyRepository, CurrencyRepository>();
services.AddDbContext<BankDbContext>(x => x.UseSqlServer(connectionString: connectionString));
services.AddSingleton<JwtService>();
}