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

: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,5 +1,6 @@
1
-import { currentProfile, authenticator } from '../services'
2 1
 import WaveUI from '../../node_modules/wave-ui/src/wave-ui/core'
2
+import { authenticator, currentProfile } from '../services'
3
+
3 4
 const DEV_MODE = import.meta.env.VITE_DEV == 'true'
4 5
 
5 6
 async function log(to) {
@@ -13,7 +14,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 17
 const grabStoredCookie = cookieKey => {
18 18
     const cookies = document.cookie.split('; ').reduce((prev, current) => {
19 19
         const [name, ...value] = current.split('=')
@@ -28,9 +28,8 @@ const verifySession = async () => {
28 28
     const hashedAccessToken = grabStoredCookie('siimee_access')
29 29
     if (!hashedAccessToken)
30 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 33
     if (validatedToken.error) {
35 34
         console.error('ERROR :=>', validatedToken.error)
36 35
     } else {
@@ -47,7 +46,6 @@ const loginIfToken = async () => {
47 46
     ) {
48 47
         await currentProfile.login(
49 48
             sessionData.profileId,
50
-            // NOTE: probably not correct...
51 49
             WaveUI.notify,
52 50
             sessionData.accessToken,
53 51
         )

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

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

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