Issue Description: During the authentication flow on custom domain, users receive the following error on the callback URL:
{"error":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}
Environment: - Next.js App Router - @kinde-oss/kinde-auth-nextjs package - Production deployment on Vercel
Debug information shows: User authentication succeeds Callback URL receives 307 redirects Cookie domain set to .domain.com Environment variables appear correctly set in Vercel
it works on local host with no issues.
How to fix that? Where is the error: route.ts? middleware.ts? Vercel setup?