500 error after logging in with account that has been linked (Next.js SDK)

Hey,

I am using the Next.js SDK with RSC. So far so good, everything is working. I’ve setup a custom flow inside Next that links users together after login. (from user/email and Google Auth for example.)

That also works, the user is shown as a single user inside of the dashboard. However, when I log out and log in with that user afterwards, I am just getting a 500 error:

CallbackHandlerError: Callback handler failed. CAUSE: invalid_grant (Failed to verify code verifier)
    at eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/callback.js:60:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/auth.js:59:24)
    at async eval (webpack-internal:///(rsc)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:254:37) {
  code: 'ERR_CALLBACK_HANDLER_FAILURE',
  cause: IdentityProviderError: invalid_grant (Failed to verify code verifier)
      at NodeClient.callback (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/auth0-session/client/node-client.js:133:23)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/auth0-session/handlers/callback.js:37:29)
      at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/callback.js:57:13)
      at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/auth.js:59:24)
      at async eval (webpack-internal:///(rsc)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:254:37) {
    error: 'invalid_grant',
    errorDescription: 'Failed to verify code verifier',
    status: 400,
    statusCode: 400,
    openIdState: { returnTo: 'http://localhost:3000/account/' }
  },
  status: 400
}

Logging in with a non-linked user account still works normally and is not returning the error.

Hi! Did you find any solution for this, I’m also facing the same issue?