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

Viewed 504

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!

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>
Related