2fa: fix hash parsing in router
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user