瀏覽代碼

:adhesive_bandages: Fix splash page not showing up by default

brian_auth_fix
tomit4 2 年之前
父節點
當前提交
1481af21cd

+ 1
- 1
backend/lib/routes/user/validate-session.js 查看文件

85
                 return {
85
                 return {
86
                     ok: false,
86
                     ok: false,
87
                     handler: pluginConfig.handlerType,
87
                     handler: pluginConfig.handlerType,
88
-                    data: { error: err },
88
+                    data: { error: err.message },
89
                 }
89
                 }
90
             }
90
             }
91
         },
91
         },

+ 1
- 3
frontend/src/router/guards.js 查看文件

4
 const DEV_MODE = import.meta.env.VITE_DEV == 'true'
4
 const DEV_MODE = import.meta.env.VITE_DEV == 'true'
5
 
5
 
6
 async function log(to) {
6
 async function log(to) {
7
-    // if (DEV_MODE) {
8
     if (!currentProfile.isLoggedIn || !currentProfile.isComplete) {
7
     if (!currentProfile.isLoggedIn || !currentProfile.isComplete) {
9
         console.info(
8
         console.info(
10
             `[Guard Status debug]: Profile: ${currentProfile.id.value} | Login: ${currentProfile.isLoggedIn} | Complete: ${currentProfile.isComplete}`,
9
             `[Guard Status debug]: Profile: ${currentProfile.id.value} | Login: ${currentProfile.isLoggedIn} | Complete: ${currentProfile.isComplete}`,
11
         )
10
         )
12
     }
11
     }
13
     console.info('[Guard Status debug]: being routed to:', to.fullPath)
12
     console.info('[Guard Status debug]: being routed to:', to.fullPath)
14
-    // }
15
 }
13
 }
16
 
14
 
17
 const loginIfToken = async () => {
15
 const loginIfToken = async () => {
35
     if (DEV_MODE) {
33
     if (DEV_MODE) {
36
         nextCb()
34
         nextCb()
37
     } else if (
35
     } else if (
38
-        destination.meta.requiresCompleteProfile &&
36
+        destination.meta.requiresAuth &&
39
         !currentProfile.isLoggedIn &&
37
         !currentProfile.isLoggedIn &&
40
         !currentProfile.isComplete
38
         !currentProfile.isComplete
41
     ) {
39
     ) {

+ 1
- 1
frontend/src/router/index.js 查看文件

64
         path: `/onboarding/`,
64
         path: `/onboarding/`,
65
         component: OnboardingView,
65
         component: OnboardingView,
66
         name: `OnboardingView`,
66
         name: `OnboardingView`,
67
-        meta: { requiresAuth: true, requiresCompleteProfile: false },
67
+        meta: { requiresAuth: false, requiresCompleteProfile: false },
68
     },
68
     },
69
     // We must be able to get to this route BEFORE login to activate the session
69
     // We must be able to get to this route BEFORE login to activate the session
70
     {
70
     {

+ 1
- 1
frontend/src/services/auth.service.js 查看文件

24
         let validation
24
         let validation
25
         try {
25
         try {
26
             validation = await db.post('/user/validate-session', hash, true)
26
             validation = await db.post('/user/validate-session', hash, true)
27
+            if (validation.error) throw new Error(validation.error)
27
         } catch (error) {
28
         } catch (error) {
28
             console.error(`Invalid session: ${error}`)
29
             console.error(`Invalid session: ${error}`)
29
         }
30
         }
30
-        console.log('valid Session :>> ', validation)
31
         return validation
31
         return validation
32
     }
32
     }
33
     async authenticateLoginCredentials(credentials) {
33
     async authenticateLoginCredentials(credentials) {

Loading…
取消
儲存