Skip to content

Commit

Permalink
fix: add resource reset on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Kachanovsky committed Jan 17, 2025
1 parent 103d8d8 commit c7002b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions adminforth/spa/src/stores/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const useCoreStore = defineStore('core', () => {
adminUser.value = null;
}

async function resetResource() {
resource.value = null;
}

async function toggleTheme() {
theme.value = theme.value === 'light' ? 'dark' : 'light';
if (theme.value === 'light') {
Expand Down Expand Up @@ -224,5 +228,6 @@ export const useCoreStore = defineStore('core', () => {
theme,
fetchMenuBadges,
resetAdminUser,
resetResource,
}
})
1 change: 1 addition & 0 deletions adminforth/spa/src/stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const useUserStore = defineStore('user', () => {
});
reconnect();
coreStore.resetAdminUser();
coreStore.resetResource();
unauthorize();

}
Expand Down

0 comments on commit c7002b1

Please sign in to comment.