# Authorize:1 Failed to load resource: the server responded with a status of 400 () in VUE SPA

**URL:** <https://community.auth0.com/t/authorize-1-failed-to-load-resource-the-server-responded-with-a-status-of-400-in-vue-spa/64780>\
**Category:** Get Help\
**Created:** [June 21, 2021, 8:59am UTC](https://community.auth0.com/t/authorize-1-failed-to-load-resource-the-server-responded-with-a-status-of-400-in-vue-spa/64780 "2021-06-21T08:59:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferlito.sergio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ferlito.sergio/32/12949_2.png) [@ferlito.sergio](https://community.auth0.com/u/ferlito.sergio)\
**Post date:** [June 21, 2021, 8:59am UTC](https://community.auth0.com/t/authorize-1-failed-to-load-resource-the-server-responded-with-a-status-of-400-in-vue-spa/64780/1 "2021-06-21T08:59:52Z")

</div>

I have developed a VUE SPA that uses Auth0 authentication and authorization platform.  
I used `@auth0/auth0-spa-js` implementing also social logins.  
This VUE SPA works fine except for the following scenario that, sadly, for some users/clients is quite common.

- Using the login button the user authenticates and is correctly redirected to a general page
- VUE protected routes, on the client-side, and REST API with a protection middleware based on JWT, rules access to “reserved” portions of the VUE SPA
- **finally, the user closes the browser, without logging off!!!**
- **later on (authentication token expires after 90’, here I’m meaning after at least this amount of time), the user re-open the browser and tries to log in again**

This causes the following error:  
`authorize:1 Failed to load resource: the server responded with a status of 400 ()`

What is wrong with it? How to fix this issue?

Below further details (some fields replaced with XXX):

[https://airheritage.eu.auth0.com/authorize?clientId=XXXXXXXX&audience=https%3A%2F%2Fairheritage.portici.enea.it%2Frest%2Fapi&client\_id=l3OmvfIx4dfqzLWkbpp1Zv5srtGGf22K&redirect\_uri=https%3A%2F%2Fairheritage.portici.enea.it&scope=openid%20profile%20email&response\_type=code&response\_mode=web\_message&state=XXXX&nonce=XXXX&code\_challenge=XXXXX&code\_challenge\_method=S256&prompt=none&auth0Client=XXXX](https://airheritage.eu.auth0.com/authorize?clientId=XXXXXXXX&audience=https%3A%2F%2Fairheritage.portici.enea.it%2Frest%2Fapi&client_id=l3OmvfIx4dfqzLWkbpp1Zv5srtGGf22K&redirect_uri=https%3A%2F%2Fairheritage.portici.enea.it&scope=openid%20profile%20email&response_type=code&response_mode=web_message&state=XXXX&nonce=XXXX&code_challenge=XXXXX&code_challenge_method=S256&prompt=none&auth0Client=XXXX)

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

- **SDK is regarding: @auth0/auth0-spa-js**
- **SDK Version: 1.15.0**
- **Node: 14.17.0**

---

<div class="post-metadata">

**Author:** ![ferlito.sergio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ferlito.sergio/32/12949_2.png) [@ferlito.sergio](https://community.auth0.com/u/ferlito.sergio)\
**Post date:** [June 25, 2021, 9:10am UTC](https://community.auth0.com/t/authorize-1-failed-to-load-resource-the-server-responded-with-a-status-of-400-in-vue-spa/64780/2 "2021-06-25T09:10:43Z")

</div>

Finally solved…I had to add the correct url (domain from which the VUE SPA is served) to “Allowed web origins” & “Allowed Origins (CORS)” !!!

---

<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:** [June 25, 2021, 9:46am UTC](https://community.auth0.com/t/authorize-1-failed-to-load-resource-the-server-responded-with-a-status-of-400-in-vue-spa/64780/3 "2021-06-25T09:46:48Z")

</div>

Glad you have figured it out and thanks for sharing 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:** [July 10, 2021, 9:47am UTC](https://community.auth0.com/t/authorize-1-failed-to-load-resource-the-server-responded-with-a-status-of-400-in-vue-spa/64780/4 "2021-07-10T09:47:02Z")

</div>

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