Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i exempt a specific route/page from login/authorization in a Nuxt and Vue SSR web app?

I have a web app that is only accessible to authorized users with a login. I would like to be able to share a link to a specific, isolated page/route in this app that everyone with the link should be able to access, without login and authorization, and without being able to navigate anywhere else in the app.

My app is server side rendered and based on a Nuxt and Vue environment. How might i go about doing this? Is it possible to achieve this solely through the auth module of Nuxt, or are there other/better ways to implement this type of behaviour?

Thanks in advance for any advice and tips!

like image 846
Luckytechy Avatar asked Oct 31 '25 23:10

Luckytechy


1 Answers

Yes, it's possible with the nuxt auth module. Just add auth:false in the page(Only works under /pages directory) you want to be accessible with/without authorization.

<script>
export default {
  name:'setup',
  auth: false,
  // ... data, methods etc.
};
</script>
like image 98
mokumus Avatar answered Nov 04 '25 08:11

mokumus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!