We have a NextJS ([T3 Stack]) website on the main domain.
We have a Monolithic WordPress + Woocommerce on a sub-domain.
NOTE: We are about to code the Headless version baked into our NextJS site but wanted to find out first how to deal with Authentication.
If a user logs into either site we want to have it be the same (ideally NextAuth) login as the NextJS (NextAuth) site.
Examples –
a) User registers or logs into Monolithic WordPress-Woocommerce on the checkout page and the login also logs the user into the nextJS site and data is shared on both the NEXTJS DB at Planetscale and the mySQL DB at Cloudways DO.
b) User signs up at the NextJS site and 2 days later they go to the WooCommerce store and on the checkout page login and make the sale. See example (a) for the db setup.
c) If users logs into NextJS nextAUTH site the users are simultaneously automatically logged into the WordPress Site.
[ad_2]