Fix logout to invalidate complete Authentik session
- Change logout endpoint from proxy-only to full invalidation - Use /flows/-/default/invalidation/ endpoint - Add NUXT_PUBLIC_AUTHENTIK_URL to runtime config - Logout now closes session in all applications - Prevents automatic re-authentication after logout
This commit is contained in:
@@ -38,9 +38,10 @@ export const useAuthentik = () => {
|
|||||||
const isAuthenticated = computed(() => !!user.value)
|
const isAuthenticated = computed(() => !!user.value)
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
// Authentik Proxy Outpost maneja el logout
|
// Logout completo: invalida la sesión de Authentik completamente
|
||||||
// Redirigir a /outpost.goauthentik.io/sign_out
|
// Esto cierra sesión en todas las aplicaciones
|
||||||
navigateTo('/outpost.goauthentik.io/sign_out', { external: true })
|
const authentikUrl = useRuntimeConfig().public.authentikUrl || 'https://authentik.nucleoriofrio.com'
|
||||||
|
navigateTo(`${authentikUrl}/flows/-/default/invalidation/`, { external: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
const goToProfile = () => {
|
const goToProfile = () => {
|
||||||
|
|||||||
@@ -11,5 +11,11 @@ export default defineNuxtConfig({
|
|||||||
'@nuxt/content'
|
'@nuxt/content'
|
||||||
],
|
],
|
||||||
|
|
||||||
css: ['~/assets/css/main.css']
|
css: ['~/assets/css/main.css'],
|
||||||
|
|
||||||
|
runtimeConfig: {
|
||||||
|
public: {
|
||||||
|
authentikUrl: process.env.NUXT_PUBLIC_AUTHENTIK_URL || 'https://authentik.nucleoriofrio.com'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user