generated from pascalmartineau/wp-skeleton
minor: loggedIn => isLoggedIn
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m1s
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 1m1s
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
<LoginForm v-else />
|
<LogoutForm v-if="isLoggedIn" />
|
||||||
|
<LoginForm v-else />
|
||||||
|
</AuthState>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user