Is there a catch all for all routes inside a "main" route? /route/* #16125
Answered
by
hk86
nicholasfc
asked this question in
Help
-
I need to check if a non admin user is inside any /admin/* routes and redirect the user to a 404 page. Right now I can only do checking page by page
|
Beta Was this translation helpful? Give feedback.
Answered by
hk86
Aug 12, 2020
Replies: 1 comment 1 reply
-
Will this work for you? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nicholasfc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if (router.pathname.startsWith('/admin/') && !userIsAdmin) { router.push('/404'); }
Will this work for you?