diff --git a/dashboard/src/Index.vue b/dashboard/src/Index.vue index b588038ed..5f19263f4 100644 --- a/dashboard/src/Index.vue +++ b/dashboard/src/Index.vue @@ -131,7 +131,7 @@ function onToggleGroup(group) { } function onHashChange() { - const v = location.hash; + const v = window.location.hash.split('?')[0]; if (v === VIEWS.APPS) { view.value = VIEWS.APPS; @@ -268,7 +268,9 @@ onMounted(async () => { avatarUrl.value = `https://${config.value.adminFqdn}/api/v1/cloudron/avatar`; - if (config.value.mandatory2FA && !profile.value.twoFactorAuthenticationEnabled) window.location.hash = `/${VIEWS.PROFILE}?setup2fa`; + if (config.value.mandatory2FA && !profile.value.twoFactorAuthenticationEnabled) { + window.location.hash = '/profile?setup2fa'; // VIEWS.PROFILE has a # in front + } window.addEventListener('hashchange', onHashChange); onHashChange();