Fix session status check to preserve authentication state
Remove /api/auth/status from public routes so it receives Authentik headers. Remove logic that was clearing local auth state, which caused the page to show "No autenticado" even when user was authenticated. Now the button only displays session status without modifying the UI state.
This commit is contained in:
@@ -75,14 +75,6 @@ export const useAuthentik = () => {
|
||||
icon: 'i-heroicons-check-circle',
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
// Actualizar el state local si está desincronizado
|
||||
if (!authentikUser.value) {
|
||||
authentikUser.value = {
|
||||
...response.user,
|
||||
avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(response.user.name || response.user.username)}&background=random&size=128`
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Sin sesión en Authentik
|
||||
toast.add({
|
||||
@@ -92,11 +84,6 @@ export const useAuthentik = () => {
|
||||
icon: 'i-heroicons-exclamation-triangle',
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
// Limpiar state local si está desincronizado
|
||||
if (authentikUser.value) {
|
||||
authentikUser.value = null
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
// Error al consultar
|
||||
|
||||
Reference in New Issue
Block a user