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:
parent
77e421029c
commit
ba9f295ef2
|
@ -41,6 +41,12 @@ export async function signout() {
|
||||||
if (!$i) return;
|
if (!$i) return;
|
||||||
|
|
||||||
waiting();
|
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');
|
miLocalStorage.removeItem('account');
|
||||||
await removeAccount($i.id);
|
await removeAccount($i.id);
|
||||||
const accounts = await getAccounts();
|
const accounts = await getAccounts();
|
||||||
|
|
Loading…
Reference in New Issue