KindeK
Kinde3y ago
6 replies
IyanSR

Authentication flow state not found with NextJS Middleware

Hello, I had issue when combining NextJS Middleware and Kinde
I got error when successfull Signin / Register, and Kinde trying to navigate to callback http://localhost:3000/api/auth/kinde_callback . Error looks like this:

 ⨯ Error: Authentication flow state not found
    at AuthorizationCode.eval (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:285:35)
    at step (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:132:23)
    at Object.eval [as next] (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:73:20)
    at fulfilled (webpack-internal:///(rsc)/./node_modules/@kinde-oss/kinde-typescript-sdk/dist/sdk/oauth2-flows/AuthorizationCode.js:36:32)


I found similar issue on github https://github.com/kinde-oss/kinde-auth-nextjs/issues/86 ,but seems like not solved yet.

One of the comment on the issue says need to change the matcher,
Currently my matcher looks like the attched image.

Any help would be appreciated
image.png
GitHub
Prerequisites I have searched the repository’s issues and Kinde community to ensure my issue isn’t a duplicate I have checked the latest version of the library to replicate my issue I have read the...
Bug: Authentication flow state · Issue #86 · kinde-oss/kinde-auth-n...
Was this page helpful?