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>
This commit is contained in:
Sung Jae Lee 2025-02-01 13:35:42 +09:00 committed by GitHub
parent 77e421029c
commit ba9f295ef2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -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();