Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

VerifyView.vue 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template lang="pug">
  2. .wait-message
  3. p.verify-message Thanks for authenticating your email!
  4. p.verify-message Please give us a moment to redirect you back to the survey
  5. </template>
  6. <script>
  7. import { currentProfile, authenticator } from '../services'
  8. let hash = null
  9. export default {
  10. name: 'VerifyView',
  11. async created() {
  12. hash = this.$route.params.hashedToken
  13. let sessionData = null
  14. /** Confirm session with backend */
  15. try {
  16. if (!hash) throw new Error('URL contains no hash!')
  17. sessionData = await authenticator.verifySession(hash)
  18. if (!sessionData.hashesMatch)
  19. throw new Error('Hash is not in activeSessions!')
  20. } catch (err) {
  21. console.error(err)
  22. }
  23. /** Check if session was confirmed and is now valid in guard*/
  24. this.$router.push('/')
  25. }
  26. }
  27. </script>
  28. <style>
  29. .wait-message {
  30. margin: 5rem auto;
  31. text-align: center;
  32. width: 90%;
  33. max-width: 35rem;
  34. font-size: 150%;
  35. font-weight: bold;
  36. }
  37. </style>