Redirect users from a different subdomain

We have a wordpress multisite install with the main domain (a.com) just the presentation website and a subdomain (b.a.com) being the ‘logged in’ website where user can access the content after they log in

Auth0 is installed on the subdomain and user can login and everything works as expected
When someone visits the main website and click login it is redirected to the subdomain (b.a.com/login) and the auth0 login flow starts

But now when users visit a.com (the main domain) but it has already logged in for the member subdomain we would like to have them redirected automatically to b.a.com . How can we accomplish that knowing that the cookies are set for the subdomain ?