Losing user after redirecting to subdomain auth0-spa-js

Hello everyone!

I know this was asked before but I couldn’t find an answer that works for me…

I am working on a ReactJs application that uses Auth0 for authentication with the auth0-spa-js library. I am using the login with redirect method for authentication and I call the handleRedirectCallback() method on the redirect url.

The problem is that when I try to redirect the user to subdomain, I lose the authentication and the user have to authenticate again. I am doing the login on https://test.com and when I try to redirect to https://subdomain.test.com and I call auth0Client.isAuthenticated() it returns false even though the user just authenticated on the main host.

I was looking at solutions such as SSO and Custom Domains, but I don’t really think I need them as I read many comments where people say that it works out of the box. I added the subdomains with domain placeholders in my app’s settings.

I am looking for suggestions as I am really confused. I will attach code if needed.

Thank you!