Custom Domain issue when using same emails for the sign up process


I have custom domain installed for my tenant, which works fine excluding certain scenarios.

Example scenario:

  1. I have created an account with say, via google sign in.
  2. Now, I log out of my application (but I am still signed in with that email inside google chrome).
  3. Now, I use that email to do a normal sign up, which will send me a verification email, when I click the verification link in the email, I get redirected to the old domain/tenant name and since its not there (As I have the new custom domain set inside AUTH0_ISSUER_BASE_URL), I see an unauthorized message.

Also if I revert back to the old tenant domain(inside AUTH0_ISSUER_BASE_URL), the above flow works.
Also after getting redirected if, I manually replace the old domain with the custom domain, and refresh the page, it works.

I have followed auth0 docs, in setting up the custom domain and am using the nextjs-auth0 package.

Not sure what’s going on.

Debabrata Pramanik