<script setup lang="ts">
const supabase = useSupabaseClient()
const client = useSupabaseClient()

onMounted(async () => {
  const { data, error } = await supabase.auth.signInWithOAuth({
    provider: 'discord',
    options: {
      redirectTo: 'http://localhost:3000/confirm'
    }
  })
  if (error) {
    console.error('OAuth login failed:', error)
  }
})
</script>

<template>
  <div class="flex justify-center items-center min-h-screen">
    <Transition name="fade">
      <p class="text-lg">Redirecting to Discord...</p>
    </Transition>
  </div>
</template>

<style scoped>
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.5s ease;
}
.fade-enter-from, .fade-leave-to {
  opacity: 0;
}
</style>