Login with google with two subdomains

Hi, I want to do log-in with google on two subdomains. One is lets say x.y.ai and the other is y.ai. When a user logins in with google in those respective websites, I want them to be directed to their respective homepages. How do I do this while keep the authentication be the same across these two websites? I want their accounts to be useable across both websites.
Was this page helpful?