How to prevent users from accessing my admin route directly from the address bar: workaround in Nuxt and Vue apps
P粉178894235
P粉178894235 2023-08-26 16:23:05
0
1
584
<p>I have some pages (routes) that I only want a specific type of user (admins) to have access to. I can capture the routing event when I click a link in the app, but not when I change the URL from the address bar. How can I catch such URL changes and check the user type before allowing the user to access the page? </p>
P粉178894235
P粉178894235

reply all(1)
P粉803444331

You can use navigation routing. This documentation page is a good starting point
Navigation Guard Documentation

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template