One domain have login page and 2nd domain have dashboard

I have two apps one is nextjs which have custom login page and another one is reactjs and have dashboard, after user login we want to redirect to another domain, and also check user is valid or not.