feat: allow bypass of reset-password and verify routes for logged-in users
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Has been cancelled

This commit is contained in:
2026-03-05 15:46:59 -05:00
parent 8cdc26cb88
commit bb5330ac17

View File

@@ -264,7 +264,13 @@ router.beforeEach(async (to, from, next) => {
}
// If already logged in and trying to access /auth or landing, redirect to appropriate view
if ((to.path.startsWith('/auth') || to.path === '/') && isUserLoggedIn.value) {
// Allow reset-password and verify through even when logged in (valid use-case from profile page)
const authBypassRoutes = ['/auth/reset-password', '/auth/verify']
if (
(to.path.startsWith('/auth') || to.path === '/') &&
isUserLoggedIn.value &&
!authBypassRoutes.some((p) => to.path.startsWith(p))
) {
if (isParentAuthenticated.value) {
return next('/parent')
} else {