diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue index 7839aa6a0b..4718347ba1 100644 --- a/erpnext/public/js/education/lms/components/CourseCard.vue +++ b/erpnext/public/js/education/lms/components/CourseCard.vue @@ -42,7 +42,7 @@ export default { } }, mounted() { - this.getCourseMeta().then(data => this.courseMeta = data) + if(lms.store.checkLogin()) this.getCourseMeta().then(data => this.courseMeta = data) }, components: { AButton diff --git a/erpnext/public/js/education/lms/lms.js b/erpnext/public/js/education/lms/lms.js index 3d2bd50dcd..a98b86299f 100644 --- a/erpnext/public/js/education/lms/lms.js +++ b/erpnext/public/js/education/lms/lms.js @@ -70,6 +70,5 @@ frappe.ready(() => { if(lms.store.isLogin) lms.store.updateState() } }); - lms.debug = true }) \ No newline at end of file diff --git a/erpnext/public/js/education/lms/lmsRoot.vue b/erpnext/public/js/education/lms/lmsRoot.vue index 2af74abd8d..3a6cb80171 100644 --- a/erpnext/public/js/education/lms/lmsRoot.vue +++ b/erpnext/public/js/education/lms/lmsRoot.vue @@ -6,8 +6,5 @@ \ No newline at end of file diff --git a/erpnext/public/js/education/lms/routes.js b/erpnext/public/js/education/lms/routes.js index 5ebb1e660b..020c5974e6 100644 --- a/erpnext/public/js/education/lms/routes.js +++ b/erpnext/public/js/education/lms/routes.js @@ -40,7 +40,15 @@ const routes = [ name: 'profile', path: '/Profile', component: ProfilePage, - props: true + props: true, + beforeEnter: (to, from, next) => { + if(!lms.store.checkLogin()){ + next({name: 'home'}) + } + else { + next() + } + } } ];