fix: bugs

This commit is contained in:
sajjadtalkhabi
2026-08-17 16:59:24 +03:30
parent b2f2f89181
commit 20551fee63
7 changed files with 39 additions and 7 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
import { ROLE_HOME_ROUTES } from '@/enums'
import { useAuthStore } from '@/store/auth'
import { MAIN_SITE_URL, ROLE_HOME_ROUTES } from '@/enums'
import { tokenService } from '@/services/api/token-service'
import { shouldLandOnMainSite } from '@/features/auth/composables/useRedirectAfterLogin'
const APP_TITLE = 'مدرسه بانو'
@@ -19,6 +20,10 @@ export const guestGuard = (to) => {
if (!to.meta?.requiresGuest) return
if (tokenService.hasToken()) {
const auth = useAuthStore()
if (shouldLandOnMainSite(auth)) {
window.location.href = MAIN_SITE_URL
return false
}
return { name: ROLE_HOME_ROUTES[auth.role] || 'student-dashboard' }
}
return