diff options
| author | Sung Jae Lee <cocoa@hoto.us> | 2025-02-01 13:35:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-01 13:35:42 +0900 |
| commit | ba9f295ef2bf31cc90fa587e20b9a7655b7a1824 (patch) | |
| tree | b624a262f1ca7b2cf12f538d9e26c94024c01bf1 | |
| parent | Merge commit from fork (diff) | |
| download | sharkey-ba9f295ef2bf31cc90fa587e20b9a7655b7a1824.tar.gz sharkey-ba9f295ef2bf31cc90fa587e20b9a7655b7a1824.tar.bz2 sharkey-ba9f295ef2bf31cc90fa587e20b9a7655b7a1824.zip | |
Merge commit from fork
* fix(account): clear token cookie when signout called
* fix: cookie not cleared correctly when logout
Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com>
* feat: clear only token cookie when signout
---------
Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com>
| -rw-r--r-- | packages/frontend/src/account.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index 2f9a887720..9006150bc8 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -41,6 +41,12 @@ export async function signout() { if (!$i) return; waiting(); + document.cookie.split(';').forEach((cookie) => { + const cookieName = cookie.split('=')[0].trim(); + if (cookieName === 'token') { + document.cookie = `${cookieName}=; max-age=0; path=/`; + } + }); miLocalStorage.removeItem('account'); await removeAccount($i.id); const accounts = await getAccounts(); |