CORS in Umbraco 13 (can't see published content)
# help-with-umbraco
h
Hi all, I have several domains in the same Umbraco solution. It should be possible to edit content when you are signed in on the primary domain. Example: 1. testclinics.com (contains clinic1.com, clinic2.com, clinic3.com and so on). 2. When i'm logged into testclinics.com backoffice, it's possible to edit all the clinic pages. But when i'm hitting the "save and publish" no changes are shown on the frontend. I checked that it isn't a cache issue. I've tried to implement a CORS policy that allow "testclinics.com" to change the content. But I can't get it to work as i want to. //Program.cs builder.Services.AddCors(options => { options.AddPolicy(name: "Testclinics", builder => { builder.WithOrigins("https://testclinics.com/") .AllowAnyHeader() .AllowAnyMethod(); }); }); builder.CreateUmbracoBuilder() .AddBackOffice() .AddWebsite() .AddDeliveryApi() .AddComposers() .AddNotificationHandler() .Build(); WebApplication app = builder.Build(); await app.BootUmbracoAsync(); app.UseUmbraco() .WithMiddleware(u => { app.UseCors("Testclinics"); u.UseBackOffice(); u.UseWebsite(); }) .WithEndpoints(u => { u.EndpointRouteBuilder.MapControllerRoute( "Sitemap Controller", "/sitemap/{docType}", new { Controller = "Sitemap", Action = "Index", docType = "" }); u.UseInstallerEndpoints(); u.UseBackOfficeEndpoints(); u.UseWebsiteEndpoints(); }); Anyone who can help?
22 Views