KindeK
Kinde2y ago
3 replies
Aung.S

Post authentication redirect returning HTTP ERROR 500

I've followed Next.js quickstart guide and integrated Kinde into my Next.js app. However, when I create a new user with email and set password, it redirected me to /api/auth/kinde_callback?code=<code> but it's always returning error 500. The same thing happens for social sign in, it didn't redirect me to the account selector/allow access page of that social sign in, but it returns error 500 as well. The error is also printed out in terminal.
 ⨯ Error: Authentication flow: Received: <token> | Expected: State not found
    at AuthorizationCode.eval (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:184:35)
    at step (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:53:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:34:53)
    at fulfilled (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:25:58)
Was this page helpful?