diff --git a/client/src/components/player.vue b/client/src/components/player.vue index 30474a8..e3b2d9d 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -35,7 +35,7 @@ - +
-
+
{ - if ( - to.matched.some((record) => record.meta.requiresAuth) && - !process.env.SERVER - ) { - if (store.state.user && store.state.user?.id) { + // console.log(to); + // console.log(process.env.SERVER); + // if ( + // to.matched.some((record) => record.meta.requiresAuth) && + // !process.env.SERVER + // ) { + // if (store.state.user && store.state.user?.id) { + // next(); + // } else { + // next({ name: 'home' }); + // this.$store.dispatch('setShowAuthModal', true); + // } + // } else { + // next(); + // } + + // console.log(to); + // console.log(from); + if (to.meta.isAuth) { + if (store.state.user) { next(); } else { next({ name: 'home' }); - this.$store.dispatch('setShowAuthModal', true); } } else { next(); diff --git a/client/src/router/routes.js b/client/src/router/routes.js index 6bc4bb8..9352d0a 100644 --- a/client/src/router/routes.js +++ b/client/src/router/routes.js @@ -79,7 +79,7 @@ const routes = [ component: profile, meta: { title: 'Личный кабинет', - isAuth: false, + isAuth: true, }, children: [ {