From 11f9e260edbb7b477b84d87cf42d22fb9e02c5fb Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 1 Dec 2025 19:54:19 +0100 Subject: [PATCH] 2fa: fix hash parsing in router --- dashboard/src/Index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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();