minor: loggedIn => isLoggedIn
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m1s

This commit is contained in:
2025-09-18 13:02:00 -04:00
parent c915d658d0
commit f49c76a642
5 changed files with 20 additions and 13 deletions

View File

@@ -1,5 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
const { loginFields, login } = useAuth(); const { isLoggedIn, loginFields, login } = useAuth();
if (isLoggedIn.value) {
throw createError({ statusCode: 500, statusMessage: "Erreur serveur", message: "Le formulaire de connexion ne peut pas être affiché pour un utilisateur déjà connecté." });
}
</script> </script>
<template> <template>

View File

@@ -1,5 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
const { logout } = useAuth(); const { isLoggedIn, logout } = useAuth();
if (!isLoggedIn.value) {
throw createError({ statusCode: 500, statusMessage: "Erreur serveur", message: "Le formulaire de déconnexion ne peut pas être affiché pour un utilisateur déjà déconnecté." });
}
</script> </script>
<template> <template>

View File

@@ -1,13 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
const props = defineProps<{ showLabels: boolean }>(); const props = defineProps<{ showLabels: boolean }>();
const { loggedIn } = useUserSession(); const { isLoggedIn } = useAuth();
const label = computed(() => props.showLabels ? (loggedIn.value ? "Déconnexion" : "Connexion") : undefined); const label = computed(() => props.showLabels ? (isLoggedIn.value ? "Déconnexion" : "Connexion") : undefined);
</script> </script>
<template> <template>
<AuthState> <AuthState>
<UButton <UButton
:icon="loggedIn ? 'i-lucide-log-out' : 'i-lucide-log-in'" :icon="isLoggedIn ? 'i-lucide-log-out' : 'i-lucide-log-in'"
color="neutral" color="neutral"
to="/connexion" to="/connexion"
:label="label" :label="label"

View File

@@ -1,8 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
const props = defineProps<{ showLabels: boolean }>(); const props = defineProps<{ showLabels: boolean }>();
const { loggedIn } = useUserSession(); const { isLoggedIn } = useAuth();
const label = computed(() => props.showLabels ? (loggedIn.value ? "Déconnexion" : "Connexion") : undefined); const label = computed(() => props.showLabels ? (isLoggedIn.value ? "Espace membre" : "Devenir membre") : undefined);
const to = computed(() => loggedIn.value ? "/espace-membre" : "/devenir-membre"); const to = computed(() => isLoggedIn.value ? "/espace-membre" : "/devenir-membre");
</script> </script>
<template> <template>

View File

@@ -1,12 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
definePageMeta({ layout: "auth" }); definePageMeta({ layout: "auth" });
const { loggedIn } = useUserSession(); const { isLoggedIn } = useAuth();
useSeoMeta({ title: isLoggedIn.value ? "Déconnexion" : "Connexion" });
useSeoMeta({ title: loggedIn.value ? "Déconnexion" : "Connexion" });
</script> </script>
<template> <template>
<LogoutForm v-if="loggedIn" /> <AuthState>
<LogoutForm v-if="isLoggedIn" />
<LoginForm v-else /> <LoginForm v-else />
</AuthState>
</template> </template>