A workspace conversation is never remembered, so /admin/bots always reopens the bot's own chat.
This commit is contained in:
@@ -4,26 +4,19 @@ import type { CookieOptions } from "./cookies";
|
||||
type Params = {
|
||||
bot_id: number | string;
|
||||
/**
|
||||
* Null or undefined: the bot's own chat.
|
||||
*/
|
||||
workspace_id?: number | string | null;
|
||||
/**
|
||||
* From `isSecureRequest`, so plain HTTP over a VPN still keeps them.
|
||||
* From `isSecureRequest`, so plain HTTP over a VPN still keeps it.
|
||||
*/
|
||||
secure: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* The cookies that remember the conversation this browser is in, for
|
||||
* `setCookies`: read back by `readLastVisitedBot` on the bots' landing page.
|
||||
* `HttpOnly`, since only the server reads them, and they hold nothing but
|
||||
* two ids.
|
||||
* The cookie that remembers the bot this browser is in, for `setCookies`:
|
||||
* read back by `readLastVisitedBot` on the bots' landing page. `HttpOnly`,
|
||||
* since only the server reads it, and it holds nothing but an id. A
|
||||
* conversation inside a workspace is never remembered, so the landing page
|
||||
* always reopens the bot's own chat.
|
||||
*/
|
||||
export default function lastVisitedBotCookies({
|
||||
bot_id,
|
||||
workspace_id,
|
||||
secure,
|
||||
}: Params): CookieOptions[] {
|
||||
export default function lastVisitedBotCookies({ bot_id, secure }: Params): CookieOptions[] {
|
||||
return [
|
||||
{
|
||||
name: AppData["LastVisitedBotCookieName"],
|
||||
@@ -31,11 +24,5 @@ export default function lastVisitedBotCookies({
|
||||
secure,
|
||||
maxAge: AppData["LastVisitedCookieMaxAgeSeconds"],
|
||||
},
|
||||
// {
|
||||
// name: AppData["LastVisitedWorkspaceCookieName"],
|
||||
// value: workspace_id ? String(workspace_id) : "",
|
||||
// secure,
|
||||
// maxAge: AppData["LastVisitedCookieMaxAgeSeconds"],
|
||||
// },
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user