<template lang="pug">
.wait-message
    p.verify-message Thanks for authenticating your email {{ name }}!
    p.verify-message Please give us a moment to redirect you back to the survey
</template>

<script>
import { Authenticator } from '../services/auth.service.js'
export default {
    name: 'VerifyView',
    emits: ['resume-survey'],
    data: () => ({
        authenticator: {},
    }),
    created() {
        this.authenticator = new Authenticator()
        const hashEmail = this.$route.params.email
        const hashesMatch = this.authenticator.verifyAuthEmail(hashEmail)
        if (hashesMatch) {
            // this.$router.push(`/onboarding/${hashEmail}`)
            this.$emit('resume-survey')
        }
        // else {
        // render ERROR message above or redirect to 404 (or both?)
        // }
    },
}
</script>

<style>
.wait-message {
    margin: 5rem auto;
    text-align: center;
    width: 90%;
    max-width: 35rem;
    font-size: 150%;
    font-weight: bold;
}
</style>
