Skip to content

Commit 0772b2b

Browse files
committed
fix: fix infinite redirect, when user logouts from setting page
1 parent d737a92 commit 0772b2b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

adminforth/spa/src/views/SettingsView.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,17 @@ watch(dropdownUserButton, (el) => {
7171
});
7272
7373
onMounted(async () => {
74-
await loadMenu();
75-
loginRedirectCheckIsReady.value = true;
76-
const routeParamsPage = route?.params?.page;
77-
if (!routeParamsPage) {
78-
if (coreStore.config?.settingPages?.[0]) {
79-
setURL(coreStore.config.settingPages[0]);
74+
if (coreStore.adminUser) {
75+
await loadMenu();
76+
loginRedirectCheckIsReady.value = true;
77+
const routeParamsPage = route?.params?.page;
78+
if (!routeParamsPage) {
79+
if (coreStore.config?.settingPages?.[0]) {
80+
setURL(coreStore.config.settingPages[0]);
81+
}
82+
} else {
83+
handleURLChange(routeParamsPage as string | null);
8084
}
81-
} else {
82-
handleURLChange(routeParamsPage as string | null);
8385
}
8486
});
8587

0 commit comments

Comments
 (0)