|
|
@@ -4,14 +4,14 @@ import { authenticator, currentProfile } from '../services'
|
|
4
|
4
|
const DEV_MODE = import.meta.env.VITE_DEV == 'true'
|
|
5
|
5
|
|
|
6
|
6
|
async function log(to) {
|
|
7
|
|
- if (DEV_MODE) {
|
|
8
|
|
- if (!currentProfile.isLoggedIn || !currentProfile.isComplete) {
|
|
9
|
|
- console.info(
|
|
10
|
|
- `[Guard Status debug]: Profile: ${currentProfile.id.value} | Login: ${currentProfile.isLoggedIn} | Complete: ${currentProfile.isComplete}`,
|
|
11
|
|
- )
|
|
12
|
|
- }
|
|
13
|
|
- console.info('[Guard Status debug]: being routed to:', to.fullPath)
|
|
|
7
|
+ // if (DEV_MODE) {
|
|
|
8
|
+ if (!currentProfile.isLoggedIn || !currentProfile.isComplete) {
|
|
|
9
|
+ console.info(
|
|
|
10
|
+ `[Guard Status debug]: Profile: ${currentProfile.id.value} | Login: ${currentProfile.isLoggedIn} | Complete: ${currentProfile.isComplete}`,
|
|
|
11
|
+ )
|
|
14
|
12
|
}
|
|
|
13
|
+ console.info('[Guard Status debug]: being routed to:', to.fullPath)
|
|
|
14
|
+ // }
|
|
15
|
15
|
}
|
|
16
|
16
|
|
|
17
|
17
|
const loginIfToken = async () => {
|
|
|
@@ -41,13 +41,13 @@ const checkLoginStatus = async (destination, nextCb) => {
|
|
41
|
41
|
!currentProfile.isLoggedIn &&
|
|
42
|
42
|
!currentProfile.isComplete
|
|
43
|
43
|
) {
|
|
44
|
|
- nextCb('onboarding')
|
|
|
44
|
+ nextCb('/onboarding')
|
|
45
|
45
|
} else if (
|
|
46
|
46
|
destination.meta.requiresCompleteProfile &&
|
|
47
|
47
|
destination.meta.requiresAuth &&
|
|
48
|
48
|
!currentProfile.isLoggedIn
|
|
49
|
49
|
) {
|
|
50
|
|
- nextCb('login')
|
|
|
50
|
+ nextCb('/login')
|
|
51
|
51
|
} else {
|
|
52
|
52
|
nextCb()
|
|
53
|
53
|
}
|