# Auth0 and Vue Error: Unauthorized

**URL:** <https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275>\
**Category:** Get Help\
**Tags:** vue-3, vuejs, vue, authentication, auth0\
**Created:** [April 24, 2022, 7:45am UTC](https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275 "2022-04-24T07:45:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chemmso](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@chemmso](https://community.auth0.com/u/chemmso)\
**Post date:** [April 24, 2022, 7:45am UTC](https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275/1 "2022-04-24T07:45:40Z")

</div>

I’m trying to set up Auth0 in a Vue app using auth0-vue and the samples contained in the repo, however I am getting 2 different errors in my console and I am not sure why. The first error I get is as soon as I load my vue app:

```auto
auth0-spa-js.production.esm.js?d777:15 Uncaught (in promise) Error: Invalid state
    at eval (auth0-spa-js.production.esm.js?d777:15:1)
    at eval (auth0-spa-js.production.esm.js?d777:15:1)
    at Object.eval [as next] (auth0-spa-js.production.esm.js?d777:15:1)
    at eval (auth0-spa-js.production.esm.js?d777:15:1)
    at new Promise (<anonymous>)
    at d (auth0-spa-js.production.esm.js?d777:15:1)
    at e.handleRedirectCallback (auth0-spa-js.production.esm.js?d777:15:1)
    at eval (client.proxy.ts?bd0e:110:1)
    at eval (client.proxy.ts?bd0e:43:1)
    at eval (tslib.es6.js?b1de:102:1)

```

When I click the login button, I am directed to the Auth0 login page. Upon filling in my details I am redirected back to my app with this error in the console:

```auto
auth0-spa-js.production.esm.js?d777:15 Uncaught (in promise) Error: Unauthorized
    at new t (auth0-spa-js.production.esm.js?d777:15:1)
    at eval (auth0-spa-js.production.esm.js?d777:15:1)
    at eval (auth0-spa-js.production.esm.js?d777:15:1)
    at Object.eval [as next] (auth0-spa-js.production.esm.js?d777:15:1)
    at c (auth0-spa-js.production.esm.js?d777:15:1)

```

Anyone have a clue what I’m doing wrong here? I’ve pushed it up to GitHub and my login button is inside `/components/Navbar.vue`.

Additional info, I saw in the nextjs auth0 sdk that a client secret is provided, and on my ruby backend I also make use of the client secret, yet I don’t see this mentioned anywhere with vue. Could this have something to do with it?

[https://github.com/nolyoi/vue-auth0-test](https://github.com/nolyoi/vue-auth0-test)

---

<div class="post-metadata">

**Author:** ![chemmso](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@chemmso](https://community.auth0.com/u/chemmso)\
**Post date:** [April 24, 2022, 8:54am UTC](https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275/3 "2022-04-24T08:54:41Z")

</div>

Update, just tried a nextjs example and that works fine. I’m guessing it has to do with the client secret. Is this flow not supported with vue?

---

<div class="post-metadata">

**Author:** ![guybrush](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/guybrush/32/33545_2.png) [@guybrush](https://community.auth0.com/u/guybrush)\
**Post date:** [May 19, 2022, 9:57am UTC](https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275/4 "2022-05-19T09:57:22Z")

</div>

Know you’ve probaly sorted by now, but I think the issue you had was that you need to set “Application Type” to “Single Page Application” and “Token Endpoint Authentication Method” to “None”

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 19, 2022, 11:37am UTC](https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275/5 "2022-05-19T11:37:13Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 1:31pm UTC](https://community.auth0.com/t/auth0-and-vue-error-unauthorized/82275/6 "2022-07-28T13:31:20Z")

</div>


