Feature/phone register (#11)
Co-authored-by: ISMAIL MASSERAN <topaz@ISMAILs-Macbook.local> Co-authored-by: ISMAIL MASSERAN <topaz@Mac.dlinkrouter.local> Reviewed-on: #11
This commit was merged in pull request #11.
This commit is contained in:
@@ -13,6 +13,7 @@ import { activityLayoutRoutes } from '@/modules/activity'
|
||||
import { dashboardLayoutRoutes } from '@/modules/dashboard'
|
||||
import { externalSystemLayoutRoutes } from '@/modules/external-system'
|
||||
import { activityLogLayoutRoutes } from '@/modules/activity-log'
|
||||
import { feedbackPublicRoutes, feedbackLayoutRoutes } from '@/modules/feedback'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -30,15 +31,17 @@ const router = createRouter({
|
||||
...activityLayoutRoutes,
|
||||
...externalSystemLayoutRoutes,
|
||||
...membershipApplicationLayoutRoutes,
|
||||
...feedbackLayoutRoutes,
|
||||
],
|
||||
},
|
||||
...authPublicRoutes,
|
||||
...membershipApplicationPublicRoutes,
|
||||
...feedbackPublicRoutes,
|
||||
...profilePublicRoutes,
|
||||
],
|
||||
})
|
||||
|
||||
const PUBLIC_ROUTE_NAMES = new Set(['login', 'register', 'verify-email', 'membership-application-apply'])
|
||||
const PUBLIC_ROUTE_NAMES = new Set(['login', 'register', 'membership-application-apply', 'feedback-submit'])
|
||||
|
||||
router.beforeEach(async (to) => {
|
||||
const authStore = useAuthStore(pinia)
|
||||
@@ -66,11 +69,11 @@ router.beforeEach(async (to) => {
|
||||
return true
|
||||
}
|
||||
|
||||
// Redirect authenticated users away from login/register/verify-email.
|
||||
if (
|
||||
authStore.isAuthenticated &&
|
||||
PUBLIC_ROUTE_NAMES.has(routeName) &&
|
||||
routeName !== 'membership-application-apply'
|
||||
routeName !== 'membership-application-apply' &&
|
||||
routeName !== 'feedback-submit'
|
||||
) {
|
||||
return resolvePostAuthRoute(authStore.user)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user