Teamwork makes the dreamwork!
I’d love to see an official implementation for vue3!
are there any updates on that?
Unfortunately not yet but I will let you know as soon as it’s there!
This is quite a long lived thread… Vue3 has been live for over a year, more and more organisations are adopting Vue, where’s the quick-start guide?
Reaching out to the team to follow-up with them on that front. Will let you know as soon as they provide me with a response
I just got a response from the team that this will happen once the SDK team author their Vue SDK.
Going to add my vote for this!
Need this quickstart: Vue 3 + TypeScript + Auth0
I’m really struggling here.
I really hear all this and I’m doing my best to advocate for all your +1s!
Yes it’s ridiculous.
Also the existing open source solutions posted by community members, although better than nothing, are still quite buggy.
If anyone has been having difficulties like me, after some extensive Googling I found this Vue3/ Nuxt implementation with Auth0:
I’m going to spend the day testing/ implementing and seeing if I can port my code over to this template, if it works then it might be a good alternative.
Alexey’s solution is the most correct and working out of all the ones I tried in this thread, big thank you to him.
If you want a Vue 3 Plugin then I suggest trying vue-auth0-plugin:
npm vue-auth0-plugin
It is based on the Auth0-spa-sdk, plugs in nicely and seems to work well. I asked for a minor change, and it was implemented within 48 hours, so a responsive maintainer too.
I have written a sample app - just to try it out, if you need an example of it in use. It is a bit rough and ready, but might be useful, so I made it public.
Thank you for sharing all that with the rest of community!
Have you had any issues with Auth0Client being null on page refresh? I can get everything to work perfectly on the initial run, but after I’ve authenticated and I refresh the page, or leave and return, the auth0client value is null.
The client isn’t being reloaded because I’m already cookied as authenticated, which makes sense, but there is a lot of functionality that relies on values from auth0client, so not sure why it wouldn’t reload on refresh.
Any thoughts on this? I can provide more context if necessary.
No, that is not my experience. That sounds to me as though you are possibly not awaiting something. Are you using the plugin I mentioned above, or using the Auth0 sdk directly?
It appears a number of people have come to similar solutions. I’ve rewritten the Auth0 Login Vue 2 quickstart with Vue 3 Composition API + Typescript here:
This example is purist Composition API (no use of provide/inject) and requires useAuth()
to be called within consuming components.
Thanks for sharing that with the rest of community!
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
If you are looking for examples on how to use Auth0 with Vue 3.0, please check out the following code samples
Vue 3.0 + JavaScript:
Vue 3.0 + TypeScript: