| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <template lang="pug">
- .wait-message
- p.verify-message Thanks for authenticating your email!
- p.verify-message Please give us a moment to redirect you back to the survey
- </template>
-
- <script>
- import { currentProfile, authenticator } from '../services'
- let hash = null
- export default {
- name: 'VerifyView',
- async created() {
- hash = this.$route.params.hashedToken
- let sessionData = null
- /** Confirm session with backend */
- try {
- if (!hash) throw new Error('URL contains no hash!')
- sessionData = await authenticator.verifySession(hash)
- if (!sessionData.hashesMatch)
- throw new Error('Hash is not in activeSessions!')
- } catch (err) {
- console.error(err)
- }
- /** Check if session was confirmed and is now valid in guard*/
- this.$router.push('/')
- }
- }
- </script>
-
- <style>
- .wait-message {
- margin: 5rem auto;
- text-align: center;
- width: 90%;
- max-width: 35rem;
- font-size: 150%;
- font-weight: bold;
- }
- </style>
|