diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue index 7839aa6a0b3..4718347ba1d 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 3d2bd50dcd7..a98b86299f7 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 2af74abd8d5..3a6cb801712 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 5ebb1e660bd..020c5974e63 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() + } + } } ];