Bläddra i källkod

:recycle: throw in another log for url verify

brian_lifecycle_docs
j 2 år sedan
förälder
incheckning
1bbab05475
1 ändrade filer med 4 tillägg och 5 borttagningar
  1. 4
    5
      frontend/src/views/VerifyView.vue

+ 4
- 5
frontend/src/views/VerifyView.vue Visa fil

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

Laddar…
Avbryt
Spara