|
|
@@ -12,11 +12,13 @@ export default {
|
|
12
|
12
|
async created() {
|
|
13
|
13
|
hash = this.$route.params.hashedToken
|
|
14
|
14
|
try {
|
|
15
|
|
- this.isHashInUrl(hash)
|
|
16
|
|
- await this.verifyActiveSession(hash)
|
|
|
15
|
+ if (!hash) throw new Error('URL contains no hash!')
|
|
|
16
|
+ const verifiedFromUrlHash = await this.verifyActiveSession(hash)
|
|
|
17
|
+ console.log('verifiedFromUrlHash :>> ', verifiedFromUrlHash)
|
|
17
|
18
|
const sessionData = await authenticator.verifySessionCookie()
|
|
18
|
19
|
if (!sessionData)
|
|
19
|
20
|
throw new Error(`Could not verify session from cookie.`)
|
|
|
21
|
+
|
|
20
|
22
|
currentProfile.login(
|
|
21
|
23
|
sessionData.profileId,
|
|
22
|
24
|
this.$waveui.notify,
|
|
|
@@ -28,9 +30,6 @@ export default {
|
|
28
|
30
|
this.$router.push('/')
|
|
29
|
31
|
},
|
|
30
|
32
|
methods: {
|
|
31
|
|
- isHashInUrl(hash) {
|
|
32
|
|
- if (!hash) throw new Error('URL contains no hash!')
|
|
33
|
|
- },
|
|
34
|
33
|
async verifyActiveSession(hashedToken) {
|
|
35
|
34
|
const sessionData = await authenticator.verifySession(hashedToken)
|
|
36
|
35
|
if (!sessionData.hashesMatch)
|