ソースを参照

:construction: Differentiated data from component variables

tags/0.0.3^2
tomit4 3年前
コミット
41ae7747d6
2個のファイルの変更11行の追加12行の削除
  1. 2
    2
      frontend/src/components/onboarding/Auth.vue
  2. 9
    10
      frontend/src/views/VerifyView.vue

+ 2
- 2
frontend/src/components/onboarding/Auth.vue ファイルの表示

54
             document.cookie = `siimee_session=${sessionToken}; max-age=600; path=/; secure`
54
             document.cookie = `siimee_session=${sessionToken}; max-age=600; path=/; secure`
55
             await this.authenticator.sendAuthEmail(this.answered)
55
             await this.authenticator.sendAuthEmail(this.answered)
56
         } catch (err) {
56
         } catch (err) {
57
-            // TODO: redirect to an error page displaying which
58
-            // error occurred and how to reach out to staff??
57
+            // TODO: render an error page in this component displaying which
58
+            // error occurred and how to reach out to staff
59
             console.error('ERROR :=>', err)
59
             console.error('ERROR :=>', err)
60
         }
60
         }
61
     },
61
     },

+ 9
- 10
frontend/src/views/VerifyView.vue ファイルの表示

6
 
6
 
7
 <script>
7
 <script>
8
 import { Authenticator } from '../services/auth.service.js'
8
 import { Authenticator } from '../services/auth.service.js'
9
+let hash = null
10
+let sessionToken = null
9
 export default {
11
 export default {
10
     name: 'VerifyView',
12
     name: 'VerifyView',
11
     data: () => ({
13
     data: () => ({
12
         authenticator: {},
14
         authenticator: {},
13
-        answers: {},
14
-        hash: undefined,
15
-        sessionToken: undefined,
16
     }),
15
     }),
17
     async created() {
16
     async created() {
18
         this.authenticator = new Authenticator()
17
         this.authenticator = new Authenticator()
19
-        this.hash = this.$route.params.email
20
-        this.sessionToken = this.grabCookie('siimee_session')
18
+        hash = this.$route.params.email
19
+        sessionToken = this.grabCookie('siimee_session')
21
         try {
20
         try {
22
-            this.isHashInUrl(this.hash)
23
-            this.doesEmailMatch(this.hash)
24
-            this.doesSessionTokenExist(this.sessionToken)
25
-            this.isSessionTokenValid(this.sessionToken)
21
+            this.isHashInUrl(hash)
22
+            this.doesEmailMatch(hash)
23
+            this.doesSessionTokenExist(sessionToken)
24
+            this.isSessionTokenValid(sessionToken)
26
         } catch (err) {
25
         } catch (err) {
27
             console.error(err)
26
             console.error(err)
28
         }
27
         }
68
                 throw new Error(sessionTokenIsValid.error)
67
                 throw new Error(sessionTokenIsValid.error)
69
             } else {
68
             } else {
70
                 // TODO: Does accessToken need sessionToken data?
69
                 // TODO: Does accessToken need sessionToken data?
71
-                await this.getAccessToken(...this.sessionToken)
70
+                await this.getAccessToken(...sessionToken)
72
             }
71
             }
73
         },
72
         },
74
     },
73
     },

読み込み中…
キャンセル
保存