Vue 3 User Authentication: Options API Guide with JavaScript

This JavaScript guide will help you learn how to secure a Vue 3 application that uses the Options API. You’ll learn how to use the Vue 3 Options API along with the Auth0 Vue SDK to implement user authentication, route protection, and access protected data from external APIs.

3 Likes

I invoke createAuth0() inside a Quasar boot file, and this.$auth0 becomes available to my components as expected.
But the non-functions inside this.$auth0 only works when I add “.value” to the references, like this.$auth0.isLoading.value and this.$auth0.isAuthenticated.value.

Am I doing something wrong, or is this actually the correct way?

Hello!

Thanks for following the guide and joining the Auth0 Community. There was a recent change on the SDK to another major version. We are working on updating the guide to present this change correctly so that we can provide support to both the SDK v1 and v2.

You can solve this issue on the meantime by installing the Auth0 Vue SDK using this command:

npm install @auth0/auth0-vue@1.0.3

We’ll update this forum as soon as the guides are updated. Thanks for your feedback!