fix: Refactor navbar styling in layout editor and update page title in layout designer
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user