# handleRedirectCallback invalid state

**URL:** <https://community.auth0.com/t/handleredirectcallback-invalid-state/107558>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [May 22, 2023, 6:44pm UTC](https://community.auth0.com/t/handleredirectcallback-invalid-state/107558 "2023-05-22T18:44:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RareDevil](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raredevil/32/47458_2.png) [@RareDevil](https://community.auth0.com/u/RareDevil)\
**Post date:** [May 22, 2023, 6:44pm UTC](https://community.auth0.com/t/handleredirectcallback-invalid-state/107558/1 "2023-05-22T18:44:46Z")

</div>

I have now tried everything I could find on how to resolve my problem. But I keep getting the same error `Invalid state` after a successful login and redirection back to my application.

So far, I narrowed it down to be handleRedirectCallback function that gives me the error, but I am not able to find out why I get the error.

This is the code used to initialize auth0 into my Vue application.  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/9/9/995dffa8ab9a0cdfce5379717b57717d8afcd805.png)

And this is the code used to handle the callback after redirection back from auth0

 ![image](https://global.discourse-cdn.com/auth0/original/3X/7/5/75e7ccc9f35f1c7180925813d3781c300405446d.png)

---

<div class="post-metadata">

**Author:** ![RareDevil](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raredevil/32/47458_2.png) [@RareDevil](https://community.auth0.com/u/RareDevil)\
**Post date:** [May 24, 2023, 8:14am UTC](https://community.auth0.com/t/handleredirectcallback-invalid-state/107558/2 "2023-05-24T08:14:49Z")

</div>

I found a solution.  
For some reason, I had to set the cacheLocation inside the createAuth0. But after setting that, I also did not need to handle the redirect callback with the handleRedirectCallback.

---

<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 24, 2023, 8:54am UTC](https://community.auth0.com/t/handleredirectcallback-invalid-state/107558/3 "2023-05-24T08:54:08Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 7, 2023, 8:54am UTC](https://community.auth0.com/t/handleredirectcallback-invalid-state/107558/4 "2023-06-07T08:54:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
