fix: preserve scoped utility topology and refresh sessions across tabs

This commit is contained in:
jhartworks committed 2026-11-16 16:38:10 +01:00
1 parent 1d67e8ceba
commit 984d9af232
6 files changed
+58 -24

No files matched your search

+6
View File
@@ -160,6 +160,12 @@ try {
await page.waitForFunction(() => window.authPanel.shadowRoot.querySelector("nf-editor")?.shadowRoot);
}
await page.screenshot({ path: join(out, `symcon-access-${name}.png`) });
if (name === "admin") {
const switched = new Client(); assert.equal((await switched.login("reader", "reader-new-test-password")).status, 303);
await context.setCookie({ name: "NFSC_Session_12345", value: switched.cookies.get("NFSC_Session_12345"), url: base + hook + "/", path: hook + "/", httpOnly: true, sameSite: "Strict" });
await page.waitForFunction(() => document.querySelector("nextfloor-panel")?.hass?.user?.name === "reader");
assert.equal(await page.evaluate(() => document.querySelector("nextfloor-panel").hass.user.is_admin), false, "a shared-cookie account switch removes stale admin data in other tabs");
}
if (name === "reader") {
await Promise.all([page.waitForNavigation({ waitUntil: "networkidle0" }), page.click('.nf-session-bar button')]);
await page.waitForSelector("#username"); await page.goBack({ waitUntil: "networkidle0" });