# Custom domain and token issue

**URL:** <https://community.auth0.com/t/custom-domain-and-token-issue/112665>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [August 2, 2023, 8:37am UTC](https://community.auth0.com/t/custom-domain-and-token-issue/112665 "2023-08-02T08:37:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaclav.stummer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vaclav.stummer/32/33629_2.png) [@vaclav.stummer](https://community.auth0.com/u/vaclav.stummer)\
**Post date:** [August 2, 2023, 8:37am UTC](https://community.auth0.com/t/custom-domain-and-token-issue/112665/1 "2023-08-02T08:37:19Z")

</div>

Hey community,

We recently implemented a custom domain for our platform. But it seems that there is a problem with the authentication token. We are using `auth0-react` SDK with this config:

```auto
<Auth0Provider 
  domain={<OUR_CUSTOM_DOMAIN>}
  clientId={<APP_CLIENT_ID>}
  onRedirectCallback={(appState?: AppState) => {
		history.push(appState && appState.returnTo ? appState.returnTo : window.location.pathname)
  }}
  cache={new LocalStorageCache()}
  useRefreshTokens=true
  authorizationParams={{
    audience: `https://${<ORIGINAL_DOMAIN>}/api/v2/`,
    screen_hint: signUpMethod === undefined ? 'login' : 'signup',
    organization: undefined,
    redirect_uri: <REDIRECT_URL>
  }}
>
  ...
<Auth0Provider >

```

Errors:

 ![Screenshot 2023-08-02 at 10.22.09](https://global.discourse-cdn.com/auth0/original/3X/c/d/cd8e877a9ed8764eb4983bf027304586e4424ee9.png)  
 ![Screenshot 2023-08-02 at 10.22.17](https://global.discourse-cdn.com/auth0/original/3X/c/c/cc1950f6d85ed974e403d8dc3548506e9b8b6dde.jpeg)  
 ![Screenshot 2023-08-02 at 10.22.26](https://global.discourse-cdn.com/auth0/original/3X/2/4/24f086d6321adbd82f51a8996c221921a9589fb1.jpeg)

Can you please point us out where could be the problem? Also, another thing is on our dev environment it seems to work fine. On the staging, where we also use the auth0 development environment it doesn’t work, which is strange even though both of them are configured in the same way

---

<div class="post-metadata">

**Author:** ![vaclav.stummer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vaclav.stummer/32/33629_2.png) [@vaclav.stummer](https://community.auth0.com/u/vaclav.stummer)\
**Post date:** [August 3, 2023, 10:34am UTC](https://community.auth0.com/t/custom-domain-and-token-issue/112665/2 "2023-08-03T10:34:18Z")

</div>

In the end, we find out that the problem was caused by something unrelated to the auth0. It was wrongly configured sentry, where wild card was used and it was breaking CORS headers for auth0 [Distributed Tracing for Browser JavaScript | Sentry Documentation](https://docs.sentry.io/platforms/javascript/usage/distributed-tracing/)

---

<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:** [August 17, 2023, 10:34am UTC](https://community.auth0.com/t/custom-domain-and-token-issue/112665/3 "2023-08-17T10:34:24Z")

</div>

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