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