From d688ab64e1706408adf8a158ad1d4b2c5ce855af Mon Sep 17 00:00:00 2001 From: jamesread Date: Thu, 6 Nov 2025 15:29:39 +0000 Subject: [PATCH] fix: #696 - hide login link if login interactively isn't possible (local user or oauth2) --- frontend/resources/vue/App.vue | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/resources/vue/App.vue b/frontend/resources/vue/App.vue index 8e552bf..fa555b5 100644 --- a/frontend/resources/vue/App.vue +++ b/frontend/resources/vue/App.vue @@ -8,11 +8,11 @@ @@ -71,7 +71,7 @@ import logoUrl from '../../OliveTinLogo.png'; const router = useRouter(); const sidebar = ref(null); -const username = ref('guest'); +const username = ref('notset'); const isLoggedIn = ref(false); const serverConnection = ref('Connected'); const currentVersion = ref('?'); @@ -84,6 +84,7 @@ const showLogs = ref(true) const showDiagnostics = ref(true) const initError = ref(false) const initErrorMessage = ref('') +const showLoginLink = ref(true) function toggleSidebar() { if (sidebar.value && showNavigation.value) { @@ -102,6 +103,10 @@ function updateHeaderFromInit() { showNavigation.value = window.initResponse.showNavigation showLogs.value = window.initResponse.showLogList showDiagnostics.value = window.initResponse.showDiagnostics + + if (!window.initResponse.authLocalLogin && window.initResponse.oAuth2Providers.length === 0) { + showLoginLink.value = false + } } } @@ -124,15 +129,7 @@ async function requestInit() { window.initErrorMessage = '' window.initCompleted = true - username.value = initResponse.authenticatedUser - isLoggedIn.value = initResponse.authenticatedUser !== '' && initResponse.authenticatedUser !== 'guest' - currentVersion.value = initResponse.currentVersion - bannerMessage.value = initResponse.bannerMessage || ''; - bannerCss.value = initResponse.bannerCss || ''; - showFooter.value = initResponse.showFooter - showNavigation.value = initResponse.showNavigation - showLogs.value = initResponse.showLogList - showDiagnostics.value = initResponse.showDiagnostics + window.updateHeaderFromInit() if (showNavigation.value && sidebar.value) { for (const rootDashboard of initResponse.rootDashboards) {