|
|
@@ -11,21 +11,23 @@ export default {
|
|
11
|
11
|
name: 'VerifyView',
|
|
12
|
12
|
async created() {
|
|
13
|
13
|
hash = this.$route.params.hashedToken
|
|
|
14
|
+ let sessionData = null
|
|
|
15
|
+ /** Confirm session with backend */
|
|
14
|
16
|
try {
|
|
15
|
17
|
if (!hash) throw new Error('URL contains no hash!')
|
|
16
|
|
- const sessionData = await authenticator.verifySession(hash)
|
|
|
18
|
+ sessionData = await authenticator.verifySession(hash)
|
|
17
|
19
|
if (!sessionData.hashesMatch)
|
|
18
|
20
|
throw new Error('Hash is not in activeSessions!')
|
|
19
|
|
-
|
|
20
|
|
- await authenticator.checkSessionValid()
|
|
21
|
|
- currentProfile.login(
|
|
22
|
|
- sessionData.profileId,
|
|
23
|
|
- this.$waveui.notify,
|
|
24
|
|
- sessionData.accessToken,
|
|
25
|
|
- )
|
|
26
|
21
|
} catch (err) {
|
|
27
|
22
|
console.error(err)
|
|
28
|
23
|
}
|
|
|
24
|
+ /** Check if session was confirmed and is now valid */
|
|
|
25
|
+ await authenticator.checkSessionValid()
|
|
|
26
|
+ currentProfile.login(
|
|
|
27
|
+ sessionData.profileId,
|
|
|
28
|
+ this.$waveui.notify,
|
|
|
29
|
+ sessionData.accessToken,
|
|
|
30
|
+ )
|
|
29
|
31
|
this.$router.push('/')
|
|
30
|
32
|
}
|
|
31
|
33
|
}
|