fix: logout
gitea/hedera-web/pipeline/pr-beta This commit looks good Details

This commit is contained in:
Javier Segarra 2025-01-17 23:55:01 +01:00
parent 9b1765e9bf
commit 3630a72b78
1 changed files with 6 additions and 6 deletions

View File

@ -37,11 +37,12 @@ export const useUserStore = defineStore('user', () => {
if (!autoLoginStatus) { if (!autoLoginStatus) {
router.push({ name: 'login' }); router.push({ name: 'login' });
} }
} else {
await fetchTokenConfig();
await fetchUser();
await supplantInit();
startInterval();
} }
await fetchTokenConfig();
await fetchUser();
await supplantInit();
startInterval();
}; };
const getToken = () => { const getToken = () => {
@ -173,9 +174,8 @@ export const useUserStore = defineStore('user', () => {
const logout = async () => { const logout = async () => {
try { try {
await api.post('Accounts/logout'); await destroy();
} catch (e) {} } catch (e) {}
destroy();
useAppStore().onLogout(); useAppStore().onLogout();
}; };