Revert "fix: implementar manejo correcto de modo offline"
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 25s

This reverts commit eedff715d4.
This commit is contained in:
2025-10-17 16:08:11 -06:00
parent c770ae14b5
commit 192d8a7e79
2 changed files with 11 additions and 89 deletions

View File

@@ -60,7 +60,7 @@
<script setup>
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'
import { UserCheck, UserX, Loader, ShieldAlert, ChevronDown, RefreshCw, LogOut, WifiOff } from 'lucide-vue-next'
import { UserCheck, UserX, Loader, ShieldAlert, ChevronDown, RefreshCw, LogOut } from 'lucide-vue-next'
import { useAuth } from '~/composables/useAuth'
import { useMusicStore } from '~/stores/music'
@@ -68,7 +68,6 @@ const {
isAuthenticated,
authChecked,
isCheckingAuth,
isOffline,
authStatus,
userInfo,
checkAuth,
@@ -125,12 +124,6 @@ watch(() => musicStore.error, (error, oldError) => {
if (error && error !== oldError) {
console.log('[AuthIndicator] Music store error detected:', error)
// Si estamos offline, NO marcar como no autenticado
if (isOffline.value) {
console.log('[AuthIndicator] Ignoring error - offline mode')
return
}
// Detectar errores de autenticación (múltiples formas)
const isAuthError =
error.includes('401') ||
@@ -151,12 +144,6 @@ watch(() => musicStore.error, (error, oldError) => {
// Watch loading state - cuando termina de cargar, verificar si hubo errores de auth
watch(() => musicStore.loading, (loading, wasLoading) => {
if (wasLoading && !loading && musicStore.error) {
// Si estamos offline, NO marcar como no autenticado
if (isOffline.value) {
console.log('[AuthIndicator] Ignoring loading error - offline mode')
return
}
// Terminó de cargar con error, verificar si es de auth
const error = musicStore.error
const isAuthError =
@@ -182,8 +169,6 @@ const iconComponent = computed(() => {
return UserCheck
case 'unauthenticated':
return UserX
case 'offline':
return WifiOff
default:
return ShieldAlert
}
@@ -197,8 +182,6 @@ const statusText = computed(() => {
return 'Conectado'
case 'unauthenticated':
return 'Reautenticar'
case 'offline':
return 'Offline'
default:
return 'Verificando...'
}
@@ -212,8 +195,6 @@ const tooltipText = computed(() => {
return 'Estás autenticado. Click para verificar estado.'
case 'unauthenticated':
return 'Sesión expirada. Click para iniciar sesión de nuevo.'
case 'offline':
return 'Sin conexión. Puedes usar contenido guardado offline.'
default:
return 'Verificando estado de autenticación...'
}
@@ -247,11 +228,7 @@ const closeDropdown = () => {
const handleClick = () => {
if (isCheckingAuth.value) return
if (authStatus.value === 'offline') {
// En modo offline, no hacer nada (ya no se puede autenticar)
console.log('[AuthIndicator] Click ignored - offline mode')
return
} else if (authStatus.value === 'unauthenticated') {
if (authStatus.value === 'unauthenticated') {
// Forzar reload de la página para que Authentik intercepte
triggerAuth()
} else if (authStatus.value === 'authenticated') {
@@ -390,16 +367,6 @@ onUnmounted(() => {
--status-color: #3b82f6;
}
.auth-indicator.offline {
--status-color: #f59e0b;
border-color: rgba(245, 158, 11, 0.3);
}
.auth-indicator.offline:hover {
border-color: rgba(245, 158, 11, 0.5);
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
/* Animation for loading state */
@keyframes spin {
from {