<template>
  <h1>Authentication callback processing...</h1>
</template>

<script setup lang="ts">
import { useKeycloak } from '~/composables/useKeycloak'

const { userManager } = useKeycloak()

onMounted(async () => {
  try {
    const user = await userManager.signinRedirectCallback()
    console.log('User logged in', user)
    await navigateTo('/')
  } catch (e) {
    console.error('Error during login', e)
  }
})
</script>
