Skip to content

Commit fcb1cf5

Browse files
chore(frontend): remove dead needsOAuth computed properties
Both ServerCard.vue and ServerDetail.vue now use healthAction from the unified health status. The needsOAuth computed properties were no longer referenced anywhere and can be safely removed.
1 parent 0949c1b commit fcb1cf5

2 files changed

Lines changed: 0 additions & 56 deletions

File tree

frontend/src/components/ServerCard.vue

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -269,54 +269,6 @@ const healthAction = computed(() => {
269269
return props.server.health?.action || ''
270270
})
271271
272-
const needsOAuth = computed(() => {
273-
// Don't show Login button if server is disabled
274-
if (!props.server.enabled) return false
275-
276-
// Don't show Login button while connecting (let the connection attempt finish)
277-
if (props.server.connecting) return false
278-
279-
if (!isHttpProtocol.value) return false
280-
281-
// Don't show Login if already connected
282-
if (props.server.connected) return false
283-
284-
// HTTP servers always support OAuth via autodiscovery, even without explicit oauth config
285-
// oauth: null (new server) and oauth: {} (explicit empty config) should both allow Login
286-
// Only require explicit oauth config for non-HTTP protocols (though they don't reach here)
287-
const hasOAuthSupport = isHttpProtocol.value || (props.server.oauth !== null && props.server.oauth !== undefined)
288-
if (!hasOAuthSupport) return false
289-
290-
// Show Login if user explicitly logged out
291-
if (props.server.user_logged_out) {
292-
return true
293-
}
294-
295-
// Use oauth_status for more accurate token state detection
296-
// Show Login if: no token, expired token, or error state
297-
const oauthStatus = props.server.oauth_status
298-
if (oauthStatus === 'expired' || oauthStatus === 'error' || oauthStatus === 'none') {
299-
return true
300-
}
301-
302-
// Fallback: if oauth_status not available, use authenticated flag
303-
// Show Login if not authenticated (no stored token)
304-
if (!props.server.authenticated) {
305-
return true
306-
}
307-
308-
// Check for OAuth-related errors that indicate re-authentication is needed
309-
const hasOAuthError = props.server.last_error && (
310-
props.server.last_error.includes('authorization') ||
311-
props.server.last_error.includes('OAuth') ||
312-
props.server.last_error.includes('401') ||
313-
props.server.last_error.includes('invalid_token') ||
314-
props.server.last_error.includes('Missing or invalid access token')
315-
)
316-
317-
return hasOAuthError
318-
})
319-
320272
const canLogout = computed(() => {
321273
// Don't show Logout button if server is disabled
322274
if (!props.server.enabled) return false

frontend/src/views/ServerDetail.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,6 @@ const isHttpProtocol = computed(() => {
470470
return server.value?.protocol === 'http' || server.value?.protocol === 'streamable-http'
471471
})
472472
473-
const needsOAuth = computed(() => {
474-
return server.value &&
475-
isHttpProtocol.value &&
476-
!server.value.connected &&
477-
server.value.enabled &&
478-
server.value.last_error?.includes('authorization')
479-
})
480-
481473
// Suggested action from unified health status
482474
const healthAction = computed(() => {
483475
return server.value?.health?.action || ''

0 commit comments

Comments
 (0)