Auth0 and Vue3 Quickstart?

Thank you! So far I got this working starting from a vite app, at least as far as getting the login button displayed. I think I just have some configuration changes to make to finish now.

A few changes I had to make, while that may not be necessary if you’re more savvy than me:

  • remove all scss or I got Error: Cannot find module 'sass' (I’m not really familiar with sass yet)
  • Remove the use of vuex store (index):1 Uncaught SyntaxError: The requested module '/@modules/vuex/dist/vuex.esm.js' does not provide an export named 'createStore'

Can you tell me what audience is in the json file? I couldn’t find out anything about that. I removed that as well.

Well a quick update. If I copy App.vue as in your repo exactly, it works. However as soon as I start to change anything the buttons won’t even render due to this wrapper: <div v-if="!$auth.loading">

However if I remove that wrapper, I get “Log out” button which only reloads the page with no errors. Maybe it has to do with the router?

For anyone else re-using Lucas’s code above (thanks a ton @lstyles, your repo is literally the only example I found online for vue3), if you’re having trouble with redirects working correctly you need to add this line:

this.error = null;

after this line:

const {appState} = await client.handleRedirectCallback()

in Lucas’s index.js file.

I spent more time than I’ll ever acknowledge learning this:)