Parcourir la source

:recycle: Removed now unnecessary console logs and old notes

tags/0.0.3^2
tomit4 il y a 2 ans
Parent
révision
013e718add

+ 0
- 2
frontend/src/components/onboarding/Auth.vue Voir le fichier

51
             const sessionToken = await this.getSessionToken({
51
             const sessionToken = await this.getSessionToken({
52
                 ...this.answered,
52
                 ...this.answered,
53
             })
53
             })
54
-            console.log('sessionToken :=>', sessionToken)
55
             const sessionInfo = await this.authenticator.sendAuthEmail({
54
             const sessionInfo = await this.authenticator.sendAuthEmail({
56
                 ...this.answered,
55
                 ...this.answered,
57
                 sessionToken: sessionToken,
56
                 sessionToken: sessionToken,
58
             })
57
             })
59
-            console.log('sessionInfo :=>', sessionInfo)
60
             document.cookie = `siimee_session=${sessionInfo.hashedSessionToken}; max-age=600; path=/; secure`
58
             document.cookie = `siimee_session=${sessionInfo.hashedSessionToken}; max-age=600; path=/; secure`
61
         } catch (err) {
59
         } catch (err) {
62
             // TODO: render an error page in this component displaying which
60
             // TODO: render an error page in this component displaying which

+ 1
- 7
frontend/src/views/LoginView.vue Voir le fichier

7
             w-input(label="Password" type="password" tile outline inner-icon-left='icon-eye')
7
             w-input(label="Password" type="password" tile outline inner-icon-left='icon-eye')
8
 
8
 
9
             //- Emit up an event so we can sync App pid with currentProfile.id
9
             //- Emit up an event so we can sync App pid with currentProfile.id
10
-            // w-button.xs12.mt12(@click="$emit('updatePid', form.profileId)" type="submit") submit
11
-            w-button.xs12.mt12(@click="something()") submit
10
+            w-button.xs12.mt12(@click="$emit('updatePid', form.profileId)" type="submit") submit
12
 </template>
11
 </template>
13
 
12
 
14
 <script>
13
 <script>
18
             profileId: null,
17
             profileId: null,
19
         },
18
         },
20
     }),
19
     }),
21
-    methods: {
22
-        something() {
23
-            console.log('something :=>')
24
-        }
25
-    }
26
 }
20
 }
27
 </script>
21
 </script>

+ 4
- 14
frontend/src/views/OnboardingView.vue Voir le fichier

61
         invalidResponse: false,
61
         invalidResponse: false,
62
         authenticator: {},
62
         authenticator: {},
63
     }),
63
     }),
64
-    // TODO: Heavy refactor comes next, now only cookie is session_token,
65
-    // which is currently a hashed Key hashedSessions{} registry on the backend
66
-    // In VerifyView.vue we have  a grabTokenFromHash() method which we can
67
-    // use here to verify any routes
68
-    // AccessToken lives on backend within hashedSessions{} registry
69
     async created() {
64
     async created() {
70
         this.survey = await surveyFactory.createSurvey()
65
         this.survey = await surveyFactory.createSurvey()
71
         this.authenticator = new Authenticator()
66
         this.authenticator = new Authenticator()
72
         hashedSessionToken = this.grabStoredCookie('siimee_session')
67
         hashedSessionToken = this.grabStoredCookie('siimee_session')
73
         try {
68
         try {
74
             const sessionData = await this.verifySession(hashedSessionToken)
69
             const sessionData = await this.verifySession(hashedSessionToken)
75
-            console.log('sessionData :=>', sessionData)
76
-            // TODO: Validate All routes hit by these methods using tokens in headers
77
-            // NOTE: This can be accomplished using sessionData.sessionToken,
78
-            // as it currently has the raw session token in it
79
-
80
-            // Move this logic onto the backend and have it
70
+            // TODO: Move this logic onto the backend and have it
81
             // returned in verifySession(hashedSessionToken)
71
             // returned in verifySession(hashedSessionToken)
82
             const userId = await this.grabUserIdByEmail(
72
             const userId = await this.grabUserIdByEmail(
83
                 sessionData.email,
73
                 sessionData.email,
117
                 cookieKey in cookies ? cookies[`${cookieKey}`] : undefined
107
                 cookieKey in cookies ? cookies[`${cookieKey}`] : undefined
118
             return cookieVal
108
             return cookieVal
119
         },
109
         },
120
-        // NOTE: sessionToken is flying around far too often
121
-        // hashedAccessToken
110
+        // TODO: sessionToken is flying around far too often,
111
+        // see above TODO regarding moving most of this logic to the backend
122
         async verifySession(hashedSessionToken) {
112
         async verifySession(hashedSessionToken) {
123
             if (!hashedSessionToken)
113
             if (!hashedSessionToken)
124
                 return console.warn('WARNING :=> sessionToken is not defined')
114
                 return console.warn('WARNING :=> sessionToken is not defined')
201
                 this.responses.push(response)
191
                 this.responses.push(response)
202
                 if (k === 'aspects') return
192
                 if (k === 'aspects') return
203
             }
193
             }
204
-            // if user as finished minimum profile creation,
194
+            // If user has finished minimum profile creation,
205
             // Adds survey answers to responses table and verifies tokens on each step
195
             // Adds survey answers to responses table and verifies tokens on each step
206
             if (currentProfileId) {
196
             if (currentProfileId) {
207
                 await surveyFactory.addNewSurveyAnswer(
197
                 await surveyFactory.addNewSurveyAnswer(

Chargement…
Annuler
Enregistrer