# Help with CORS & Custom Domain

**URL:** <https://community.auth0.com/t/help-with-cors-custom-domain/148814>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [October 7, 2024, 6:59pm UTC](https://community.auth0.com/t/help-with-cors-custom-domain/148814 "2024-10-07T18:59:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe10](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joe10/32/59823_2.png) [@joe10](https://community.auth0.com/u/joe10)\
**Post date:** [October 7, 2024, 6:59pm UTC](https://community.auth0.com/t/help-with-cors-custom-domain/148814/1 "2024-10-07T18:59:34Z")

</div>

Howdy Community,

I recently moved my application to production and applied a custom domain. However, after doing so I started to get CORS errors. Before marking the application as Production everything worked great. I deployed the change and updated to my custom domain in my app code.

Things at first looked good and was excited to see my branded login page. However once I logged in my application was failing for authentication reasons. I look at the console log and I see:

```auto
Access to fetch at 'https://auth.mydomain.com/v2/logout?client_id=dq69qUlixovcIVNq9u7a0N0IRW40w3Xn&returnTo=https%3A%2F%2Fapp.mydomain.com%2Flogout' (redirected from 'https://app.mydomain.com/api/auth/logout?_rsc=1538b') from origin 'https://app.mydomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

```

I am pretty familiar with CORS policies so I just assume I forgot to add something somewhere in Auth0 but everything looks good. I confirm `https://app.mydomain.com` is listed as an Allowed Web Origin along with valid /correct logout and callback paths.

I even tried swapping back to my dev domain and still same issue. Can anyone help out or give some advice?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 13, 2025, 10:41pm UTC](https://community.auth0.com/t/help-with-cors-custom-domain/148814/3 "2025-03-13T22:41:03Z")

</div>

Hi @joe10,

Thanks for your question.

The error you shared indicates that you were trying to fetch the logout endpoint from `https://app.mydomain.com` but were blocked by the CORS policy.

Instead of fetching the logout endpoint, we recommend redirecting your users to the logout endpoint as shown in [this example](https://auth0.com/docs/quickstart/webapp/nextjs#add-logout-to-your-application).

Let me know how this goes for you.

Thanks,  
Rueben

---

<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:** [March 31, 2025, 9:49pm UTC](https://community.auth0.com/t/help-with-cors-custom-domain/148814/5 "2025-03-31T21:49:59Z")

</div>

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