Преглед изворни кода

:pencil2: Fixed merge issues

juan-filtering-match-pool
tomit4 пре 2 година
родитељ
комит
8e0c278c6e
2 измењених фајлова са 5 додато и 6 уклоњено
  1. 4
    6
      frontend/src/router/guards.js
  2. 1
    0
      frontend/src/views/OnboardingView.vue

+ 4
- 6
frontend/src/router/guards.js Прегледај датотеку

1
-import { currentProfile, authenticator } from '../services'
2
 import WaveUI from '../../node_modules/wave-ui/src/wave-ui/core'
1
 import WaveUI from '../../node_modules/wave-ui/src/wave-ui/core'
2
+import { authenticator, currentProfile } from '../services'
3
+
3
 const DEV_MODE = import.meta.env.VITE_DEV == 'true'
4
 const DEV_MODE = import.meta.env.VITE_DEV == 'true'
4
 
5
 
5
 async function log(to) {
6
 async function log(to) {
13
     }
14
     }
14
 }
15
 }
15
 
16
 
16
-// TODO: move to utils/index.js and import to this file, OnboardingView.vue and VerifyView.vue
17
 const grabStoredCookie = cookieKey => {
17
 const grabStoredCookie = cookieKey => {
18
     const cookies = document.cookie.split('; ').reduce((prev, current) => {
18
     const cookies = document.cookie.split('; ').reduce((prev, current) => {
19
         const [name, ...value] = current.split('=')
19
         const [name, ...value] = current.split('=')
28
     const hashedAccessToken = grabStoredCookie('siimee_access')
28
     const hashedAccessToken = grabStoredCookie('siimee_access')
29
     if (!hashedAccessToken)
29
     if (!hashedAccessToken)
30
         return console.warn('WARNING :=> accessToken is not defined')
30
         return console.warn('WARNING :=> accessToken is not defined')
31
-    const validatedToken = await authenticator.validateSession(
32
-        hashedAccessToken,
33
-    )
31
+    const validatedToken =
32
+        await authenticator.validateSession(hashedAccessToken)
34
     if (validatedToken.error) {
33
     if (validatedToken.error) {
35
         console.error('ERROR :=>', validatedToken.error)
34
         console.error('ERROR :=>', validatedToken.error)
36
     } else {
35
     } else {
47
     ) {
46
     ) {
48
         await currentProfile.login(
47
         await currentProfile.login(
49
             sessionData.profileId,
48
             sessionData.profileId,
50
-            // NOTE: probably not correct...
51
             WaveUI.notify,
49
             WaveUI.notify,
52
             sessionData.accessToken,
50
             sessionData.accessToken,
53
         )
51
         )

+ 1
- 0
frontend/src/views/OnboardingView.vue Прегледај датотеку

60
         console.log('currentProfile :=>', currentProfile)
60
         console.log('currentProfile :=>', currentProfile)
61
         this.survey = await surveyFactory.createSurvey()
61
         this.survey = await surveyFactory.createSurvey()
62
         hashedAccessToken = this.grabStoredCookie('siimee_access')
62
         hashedAccessToken = this.grabStoredCookie('siimee_access')
63
+        console.log('currentProfile.isLoggedIn :=>', currentProfile.isLoggedIn)
63
         try {
64
         try {
64
             const sessionData = await this.verifySession(hashedAccessToken)
65
             const sessionData = await this.verifySession(hashedAccessToken)
65
             await currentProfile.login(
66
             await currentProfile.login(

Loading…
Откажи
Сачувај