I have set up custom domains on both our staging and production tenants. When I tested it, the flow seemed to work fine.
However, there has been an issue with my setup when I log-in, then log-out, then log-in again. When I try to log-in again, I receive an error on the server saying ApplicationError: state mismatch
and the user cannot log in again.
When I disabled Custom Domains (by changing the env var AUTH0_ISSUER_BASE_URL
back to the original value), the error disappears and the user can log in as expected.
Is there a NextJS-specific step or setting which needs to be considered as part of the Custom Domains setup?
For SPAs, it seems like there is an additional step of setting the domain
when initializing the Auth0 Client (Configure Features to Use Custom Domains). However, for NextJS which is set up as a “Regular Web Application”, there is no documented step.
How can I resolve Custom Domains on NextJS?
We are using NextJS in standalone mode hosted on AWS.