I'll make a demo app with next js that works in the following way:
- example.com/auth is used to sign in which takes the user to example.com post sign in
- if the user signs in, they will be signed in to example.com as well as a.exampe.com.
- If the user is not signed in and visits a.example.com, then will be redirected to example.com/auth