diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index 36186ecac1..2f9a887720 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -101,6 +101,9 @@ export async function removeAccount(idOrToken: Account['id']) { } function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Promise { + document.cookie = "token=; path=/; max-age=0"; + document.cookie = `token=${token}; path=/queue; max-age=86400; SameSite=Strict; Secure`; // bull dashboardの認証とかで使う + return new Promise((done, fail) => { window.fetch(`${apiUrl}/i`, { method: 'POST', @@ -213,7 +216,6 @@ export async function login(token: Account['token'], redirect?: string) { throw reason; }); miLocalStorage.setItem('account', JSON.stringify(me)); - document.cookie = `token=${token}; path=/; max-age=31536000`; // bull dashboardの認証とかで使う await addAccount(me.id, token); if (redirect) {