Код: Выделить всё
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowLocalFrontend", policy =>
{
policy.WithOrigins("http://localhost:5173", "https://localhost:5173") // Both HTTP and HTTPS
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials() // Required for cookies
.SetIsOriginAllowed(origin => true); // Allow any origin in development
});
});
< /code>
Я использую на localhost, он все еще работает.policy.WithOrigins("https://bc51b90fyae6d8.ngrok-free.app")
Подробнее здесь: https://stackoverflow.com/questions/797 ... ot-working
Мобильная версия