1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Handle branding cookies with different tenant ids

This commit is contained in:
Peter Clement 2024-02-19 09:51:10 +00:00
parent 5a29bb7eba
commit 4f05bc619b

View file

@ -10,13 +10,18 @@
$redirect("../")
}
if ($admin?.checklist?.branding) {
if ($admin.cloud && $admin?.checklist?.branding) {
let url = new URL(window.location.href)
let hostname = url.hostname
let parts = hostname.split(".")
let tenantId = parts[0]
let newTenantId = parts[0]
let domain = parts.slice(-2).join(".")
CookieUtils.setCookie("tenantId", tenantId, domain)
let existingTenantId = CookieUtils.getCookie("tenantId")
if (!existingTenantId || existingTenantId !== newTenantId) {
CookieUtils.setCookie("tenantId", newTenantId, domain)
}
}
if (