KindeK
Kinde10mo ago
7 replies
Marcin

Kinde Auth Callback Issue on my domain

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

Current Setup:
Callback URLs in Kinde dashboard:
http://localhost:3000/api/auth/kinde_callback
https://*.vercel.app/api/auth/kinde_callback
https://domain.com/api/auth/kinde_callback

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?
Was this page helpful?