Add permanent 'Iniciar Sesión' button when not authenticated
All checks were successful
build-and-deploy / build (push) Successful in 54s
build-and-deploy / deploy (push) Successful in 4s

Replace 'Ver Perfil' and 'Cerrar Sesión' buttons with a prominent
'Iniciar Sesión' button when user is not authenticated. The button
reloads the page to trigger Authentik login redirect.

This provides a more accessible way to log in compared to the toast
button, which can be difficult to click.

Button layout:
- Authenticated: [Estado de Sesión] [Ver Perfil] [Cerrar Sesión]
- Not authenticated: [Estado de Sesión] [Iniciar Sesión]
This commit is contained in:
2025-10-13 01:56:42 -06:00
parent 5676647f0f
commit a132fdfbf8

View File

@@ -1,7 +1,7 @@
<template>
<UCard class="w-full">
<div class="flex flex-wrap gap-3">
<!-- Botón de estado de sesión -->
<!-- Botón de estado de sesión (siempre visible) -->
<UButton
color="info"
size="lg"
@@ -14,6 +14,8 @@
Estado de Sesión
</UButton>
<!-- Botones cuando HAY sesión -->
<template v-if="isAuthenticated">
<!-- Botón de perfil -->
<UButton
color="primary"
@@ -38,10 +40,30 @@
</template>
Cerrar Sesión
</UButton>
</template>
<!-- Botón cuando NO hay sesión -->
<template v-else>
<UButton
color="primary"
size="lg"
@click="reloadPage"
>
<template #leading>
<UIcon name="i-heroicons-arrow-right-end-on-rectangle" />
</template>
Iniciar Sesión
</UButton>
</template>
</div>
</UCard>
</template>
<script setup lang="ts">
const { logout, goToProfile, checkSessionStatus } = useAuthentik()
const { logout, goToProfile, checkSessionStatus, isAuthenticated } = useAuthentik()
const reloadPage = () => {
// Recargar la página para forzar redirect de Authentik al login
window.location.reload()
}
</script>