feat: migrar a useAuthentik y configurar CI/CD con Gitea Actions
- Migrar de useAuth() a useAuthentik() para autenticación SSR - Actualizar componentes UserMenu, AppSidebar y profile.vue - Configurar docker-compose.yml con variables dinámicas - Agregar Gitea Actions workflow para build y deploy automático - Implementar hook de monitoreo de Gitea Actions - Configurar secrets y variables para deploy seguro - Actualizar configuración de Traefik con Authentik Forward Auth
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
const { user, loading, fetchUser, logout } = useAuth()
|
||||
const { user, isAuthenticated, logout, goToProfile } = useAuthentik()
|
||||
|
||||
// Estado para el dropdown
|
||||
const isOpen = ref(false)
|
||||
|
||||
// Cargar usuario al montar
|
||||
onMounted(() => {
|
||||
fetchUser()
|
||||
})
|
||||
|
||||
// Computed para el avatar del usuario con gradiente dinámico
|
||||
const userAvatar = computed(() => ({
|
||||
src: user.value?.avatar_url || `https://ui-avatars.com/api/?name=${encodeURIComponent(user.value?.name || user.value?.username || 'User')}&background=random&bold=true&format=svg`,
|
||||
src: user.value?.avatar || `https://ui-avatars.com/api/?name=${encodeURIComponent(user.value?.name || user.value?.username || 'User')}&background=random&bold=true&format=svg`,
|
||||
alt: user.value?.name || user.value?.username || 'User'
|
||||
}))
|
||||
|
||||
@@ -72,7 +67,7 @@ const items = computed(() => [
|
||||
|
||||
<template>
|
||||
<UDropdownMenu
|
||||
v-if="user?.authenticated && !loading"
|
||||
v-if="isAuthenticated"
|
||||
v-model:open="isOpen"
|
||||
:items="items"
|
||||
:ui="{
|
||||
@@ -194,18 +189,4 @@ const items = computed(() => [
|
||||
</div>
|
||||
</template>
|
||||
</UDropdownMenu>
|
||||
|
||||
<div
|
||||
v-else-if="loading"
|
||||
class="relative"
|
||||
>
|
||||
<USkeleton
|
||||
class="h-9 w-9"
|
||||
:ui="{
|
||||
rounded: 'rounded-full',
|
||||
background: 'bg-gradient-to-br from-gray-200 to-gray-300 dark:from-gray-700 dark:to-gray-800'
|
||||
}"
|
||||
/>
|
||||
<div class="absolute inset-0 rounded-full bg-gradient-to-br from-primary-500/20 to-transparent animate-pulse" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user