Best set up for Nuxt.js

Hi guys!
I started working with auth0-js library on my Nuxt.js app because I need two custom login/register forms provided by designers. (It seems that it is the only sdk that gives you free control about this situation)

After calling the parseHash method I have the accessToken and the idToken.

Now what is the best way to protect my pages that need authentication?

Nuxt.js provides us middlewares but they run on the server side at the first load of the page and the checkSession method return “window is not defined”.

Any suggestions are very appreciated.
Thanks in advance

there is the nuxt auth0 module you can use, where you have some functionality out of the box, without getting your hands dirty with configuration: Auth0 - nuxt auth docs

1 Like

Thanks for sharing that @p.vakalopoulos!

Hi team!

The first public beta of the Auth0 Nuxt SDK is now available for developers building web apps on the Nuxt framework!

Key Highlights

  • Idiomatic Nuxt 3 Experience: Simple, composable functions (useAuth0) that feel native to Nuxt developers, dramatically reducing time-to-first-login.
  • Advanced Security Out-of-the-Box: We’ve included support for the latest security standards from day one, including Pushed Authorization Requests (PAR), Rich Authorization Requests (RAR), and Backchannel Logout.
  • Powerful API Authentication: Seamlessly obtain tokens for backend APIs using the TokenVault integration.

Resources

Here are the helpful resources to explore the new Nuxt SDK and get started:

This SDK is still in Beta and we need your feedback! Please share any feedback, questions or comments on GitHub.

Thanks!
Dawid