fix: Refactor navbar styling in layout editor and update page title in layout designer

This commit is contained in:
Matt Batchelder
2026-04-10 20:32:49 -04:00
parent 8edcdedcd5
commit c4e26cc5b7
4 changed files with 20 additions and 16 deletions

View File

@@ -175,8 +175,13 @@
credentials: "include" // sends the CMS session cookie; follow redirects (default)
})
.then(function (response) {
// If the browser ended up on the login page, the session is not authenticated
if (!response.url || response.url.indexOf("/login") !== -1) {
var finalUrl = response.url || "";
// Not authenticated if redirected outside the CMS base path (e.g. to a SAML IdP
// at /auth/… the same origin) or to a known CMS auth page (/login, /saml/…).
var expectedBase = window.location.origin + cmsBase;
var isOffBase = cmsBase !== "" && !finalUrl.startsWith(expectedBase);
var isAuthPage = finalUrl.indexOf("/login") !== -1 || finalUrl.indexOf("/saml") !== -1;
if (!finalUrl || isOffBase || isAuthPage) {
throw new Error("unauthenticated");
}
return response;