<script setup lang="ts">
const { isLoggedIn } = useAuth();
const { isRedirecting } = useAuthConnexion();
onBeforeMount(() => (isRedirecting.value = false));
</script>

<template>
  <div id="page-connexion" class="container-sm py-12">
    <AuthState>
      <AuthRedirecting v-if="isRedirecting" />
      <template v-else>
        <AuthLoginForm v-if="!isLoggedIn" />
        <AuthLogoutForm v-else />
      </template>
    </AuthState>
  </div>
</template>
