Add session status check button
All checks were successful
build-and-deploy / build (push) Successful in 51s
build-and-deploy / deploy (push) Successful in 3s

Add new button to check and display current session status:
- New checkSessionStatus() function in useAuthentik composable
- Displays toast notification with session info
- Shows user name if authenticated or warning if not
- Add UNotifications component to app.vue to render toasts

This allows users to quickly verify their authentication status.
This commit is contained in:
2025-10-13 01:20:45 -06:00
parent 5646a84be1
commit b7285316cf
3 changed files with 39 additions and 2 deletions

View File

@@ -50,10 +50,33 @@ export const useAuthentik = () => {
navigateTo(`${authentikUrl}/if/user/`, { external: true, open: { target: '_blank' } })
}
const checkSessionStatus = () => {
const toast = useToast()
if (isAuthenticated.value && user.value) {
toast.add({
title: 'Sesión Activa',
description: `Conectado como: ${user.value.name || user.value.username}`,
color: 'success',
icon: 'i-heroicons-check-circle',
timeout: 5000
})
} else {
toast.add({
title: 'Sin Sesión',
description: 'No hay sesión activa en este momento',
color: 'warning',
icon: 'i-heroicons-exclamation-triangle',
timeout: 5000
})
}
}
return {
user,
isAuthenticated,
logout,
goToProfile
goToProfile,
checkSessionStatus
}
}