<template>
  <AuthorizationEmailConfirmation :email="email" :resend-fn="resend">
    <div v-html="$t('reset_password_instructions')" />
  </AuthorizationEmailConfirmation>
</template>

<script setup lang="ts">
definePageMeta({
  layout: 'auth',
  pageTransition: { name: 'fade', mode: 'out-in' },
  validate: route => !!route.query.email,
  // middleware: ['guest-only'],
})

const { query } = useRoute()
const { requestResetPassword } = useAuth()

const email = computed(() => query.email!.toString())

function resend() {
  requestResetPassword(email.value)
}
</script>
