feat: configuration to disable pwa

This commit is contained in:
Jannat Patel
2025-12-10 18:05:50 +05:30
parent 0877e32e1b
commit 80a217e646
11 changed files with 46 additions and 68 deletions

View File

@@ -270,7 +270,7 @@ let router = createRouter({
router.beforeEach(async (to, from, next) => {
const { userResource } = usersStore()
let { isLoggedIn } = sessionStore()
const { allowGuestAccess } = useSettings()
const { settings } = useSettings()
try {
if (isLoggedIn) {
@@ -283,8 +283,8 @@ router.beforeEach(async (to, from, next) => {
if (!isLoggedIn) {
if (to.name == 'Home') router.push({ name: 'Courses' })
await allowGuestAccess.promise
if (!allowGuestAccess.data) {
await settings.promise
if (!settings.data.allow_guest_access) {
window.location.href = '/login'
return
}