Pārlūkot izejas kodu

:recycle: let the guard handle login and session check

neo
toj 2 gadus atpakaļ
vecāks
revīzija
702ef98656

+ 1
- 0
frontend/src/router/index.js Parādīt failu

@@ -66,6 +66,7 @@ const routes = [
66 66
         name: `OnboardingView`,
67 67
         meta: { requiresAuth: true, requiresCompleteProfile: false },
68 68
     },
69
+    // We must be able to get to this route BEFORE login to activate the session
69 70
     {
70 71
         path: `/verify/:hashedToken?`,
71 72
         component: VerifyView,

+ 1
- 0
frontend/src/views/LoginView.vue Parādīt failu

@@ -53,6 +53,7 @@ export default {
53 53
                 this.emailSentSuccessfully = true
54 54
             }
55 55
             document.cookie = `siimee_session=${sessionInfo.hashedSessionToken}; max-age=600; path=/; SameSite=Lax`
56
+            console.log("set cookie:", document.cookie)
56 57
         },
57 58
     },
58 59
 }

+ 1
- 7
frontend/src/views/VerifyView.vue Parādīt failu

@@ -21,13 +21,7 @@ export default {
21 21
         } catch (err) {
22 22
             console.error(err)
23 23
         }
24
-        /** Check if session was confirmed and is now valid */
25
-        await authenticator.checkSessionValid()
26
-        currentProfile.login(
27
-            sessionData.profileId,
28
-            this.$waveui.notify,
29
-            sessionData.accessToken,
30
-        )
24
+        /** Check if session was confirmed and is now valid in guard*/
31 25
         this.$router.push('/')
32 26
     }
33 27
 }

Notiek ielāde…
Atcelt
Saglabāt