Keep only the bot cookie for the last visited bot
CI / check (push) Canceled after 0s

A workspace conversation is never remembered, so /admin/bots always
reopens the bot's own chat.
This commit is contained in:
2026-10-22 13:39:36 +01:00
parent 133e6b87c9
commit 63a93a4262
13 changed files with 48 additions and 147 deletions
-3
View File
@@ -13,9 +13,6 @@ describe("AppData auth constants", () => {
expect(AppData["LastVisitedBotCookieName"]).toBe(
`${SiteData["SiteSlug"]}_last_visited_bot_id`,
);
expect(AppData["LastVisitedWorkspaceCookieName"]).toBe(
`${SiteData["SiteSlug"]}_last_visited_workspace_id`,
);
});
test("expiry and limits are positive", () => {
+3 -5
View File
@@ -55,14 +55,12 @@ export const AppData = {
BuildCookieName: `${SiteData["SiteSlug"]}_build`,
BuildCookieMaxAgeSeconds: 365 * 24 * 60 * 60,
/**
* The conversation this browser was last in: `/admin/bots` opens it
* The bot this browser was last in: `/admin/bots` opens its own chat
* again, falling back to the coordinator (super admin) or the latest
* bot when the grant is gone. Two small ids, so the workspace one
* stays empty for a bot's own chat. `HttpOnly`: only the server reads
* them.
* bot when the grant is gone. One small id. `HttpOnly`: only the server
* reads it.
*/
LastVisitedBotCookieName: `${SiteData["SiteSlug"]}_last_visited_bot_id`,
// LastVisitedWorkspaceCookieName: `${SiteData["SiteSlug"]}_last_visited_workspace_id`,
LastVisitedCookieMaxAgeSeconds: 365 * 24 * 60 * 60,
AuthExpiryDays: 60,
APICrudBasePath: "/api/admin/crud",