Fixup password reset view

This commit is contained in:
Johannes Zellner
2025-03-25 18:05:29 +01:00
parent d8373bc488
commit 0cffd76296
6 changed files with 144 additions and 121 deletions

View File

@@ -66,8 +66,8 @@ fetcher.globalOptions.errorHook = (error) => {
return offlineOverlay.value.open();
}
// // re-login will make the code get a new token
// if (status === 401) return client.login();
// re-login will make the code get a new token
if (error.status === 401) return profileModel.logout();
if (error.status === 500 || error.status === 501) {
// actual internal server error, most likely a bug or timeout log to console only to not alert the user
@@ -140,7 +140,7 @@ function onHashChange() {
view.value = VIEWS.EVENTLOG;
} else if (v === VIEWS.NETWORK && profile.value.isAtLeastAdmin) {
view.value = VIEWS.NETWORK;
} else if (v === VIEWS.PROFILE) {
} else if (v.indexOf(VIEWS.PROFILE) === 0) {
view.value = VIEWS.PROFILE;
} else if (v === VIEWS.SERVICES && profile.value.isAtLeastAdmin) {
view.value = VIEWS.SERVICES;
@@ -175,9 +175,6 @@ onMounted(async () => {
if (error) return console.error(error);
profile.value = result;
window.addEventListener('hashchange', onHashChange);
onHashChange();
[error, result] = await dashboardModel.config();
if (error) return console.error(error);
config.value = result;
@@ -191,6 +188,11 @@ onMounted(async () => {
window.document.body.classList.add('has-background');
}
if (config.value.mandatory2FA && !profile.value.twoFactorAuthenticationEnabled) window.location.hash = `/${VIEWS.PROFILE}?setup2fa`;
window.addEventListener('hashchange', onHashChange);
onHashChange();
ready.value = true;
});