瀏覽代碼

:recycle: throw in another log for url verify

brian_lifecycle_docs
j 2 年之前
父節點
當前提交
1bbab05475
共有 1 個檔案被更改,包括 4 行新增5 行删除
  1. 4
    5
      frontend/src/views/VerifyView.vue

+ 4
- 5
frontend/src/views/VerifyView.vue 查看文件

@@ -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)

Loading…
取消
儲存