# Issue with Auth0 Login Using Custom Domain

**URL:** <https://community.auth0.com/t/issue-with-auth0-login-using-custom-domain/185961>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [April 25, 2025, 4:45pm UTC](https://community.auth0.com/t/issue-with-auth0-login-using-custom-domain/185961 "2025-04-25T16:45:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikash.jain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vikash.jain/32/71837_2.png) [@vikash.jain](https://community.auth0.com/u/vikash.jain)\
**Post date:** [April 25, 2025, 4:45pm UTC](https://community.auth0.com/t/issue-with-auth0-login-using-custom-domain/185961/1 "2025-04-25T16:45:38Z")

</div>

We are encountering an issue while logging in through Auth0 using a custom domain. The login flow initiates correctly, but upon redirection, the session values are coming back as null.

We are using the following code snippet to configure Auth0 WebAuth:

export const webAuthDragonApp = (config: AuthEnvironmentVariables) =\> {

const domain = config[‘NEXT\_PUBLIC\_AUTH0\_DOMAIN’];

const clientID = config[‘NEXT\_PUBLIC\_CLIENT\_AUTH0\_CLIENT\_ID’];

const redirectUri = config[‘NEXT\_PUBLIC\_CLIENT\_AUTH0\_LOGIN\_REDIRECT\_URL’];

const responseType = config[‘NEXT\_PUBLIC\_RESPONSE\_TYPE’];

if (!domain || !clientID || !redirectUri || !responseType) {

```
return null;

```

}

return new WebAuth({

```
domain,

clientID,

redirectUri,

responseType,

overrides: {

  __tenant: 'dev', // Your actual Auth0 tenant name

  __token_issuer: '<My Custom Domain>/' 

}

```

});

};

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [April 25, 2025, 8:48pm UTC](https://community.auth0.com/t/issue-with-auth0-login-using-custom-domain/185961/2 "2025-04-25T20:48:33Z")

</div>

Hi @vikash.jain

Welcome to the Auth0 Community!

Can you try to initialize the WebAuth without overriding the internal parameters? I suspect that they may be causing the issue with the session value. Here you can find the minimal setup → [https://auth0.com/docs/libraries/auth0js#initialization](https://auth0.com/docs/libraries/auth0js#initialization)

If your Auth.js will need to make a call to the Management API, you will need to initialize the new webAuth0 instance pointing to the Auth0 Domain not the custom one → [https://auth0.com/docs/libraries/auth0js#user-management](https://auth0.com/docs/libraries/auth0js#user-management)

Thanks  
Dawid

---

<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:** [May 9, 2025, 8:48pm UTC](https://community.auth0.com/t/issue-with-auth0-login-using-custom-domain/185961/3 "2025-05-09T20:48:43Z")

</div>

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