diff --git a/layouts/default.vue b/layouts/default.vue index 18caed2..c9be068 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -3,27 +3,92 @@ const head = useLocaleHead({ addDirAttribute: true, addSeoAttributes: true, }) +const { t } = useI18n() +const isLoggedIn = useIsLoggedIn() +const me = await useUserInfo() + +const footerLinks = [ + { text: t('footerlink_edit'), to: '/edit' }, + { + text: t('footerlink_documentation'), + to: '//yunohost.org/docs', + newWindow: true, + }, + { text: t('footerlink_support'), to: '//yunohost.org/help', newWindow: true }, + { + text: t('footerlink_administration'), + to: '/yunohost/admin/', + newWindow: true, + }, +] + +async function logout() { + const { error } = await useApi('/logout') + + if (!error.value) { + // FIXME : meh, turns out the cookie is still valid after successfully calling the route for some reason ... !? + isLoggedIn.value = false + await navigateTo('/login') + } else { + // FIXME : display an error or something + } +}