<script setup lang="ts">
// The Zitadel client processes the OIDC redirect during init(); once authenticated,
// move back to the app root.
const { auth } = useAuth();
watchEffect(() => {
  if (!auth.isLoading.value && auth.isAuthenticated.value) {
    navigateTo("/", { replace: true });
  }
});
</script>

<template>
  <main class="callback">
    <p>Signing you in…</p>
  </main>
</template>

<style scoped>
.callback {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: #6b7280;
  font: 500 1rem/1.4 system-ui, sans-serif;
}
</style>
