Nextjs-auth0 400 "Failed to verify code verifier

I have set our nextjs application with nextjs-auth0 SDK, I followed the documentation, and set everything as mentioned,

I keep getting “Failed to verify code verifier” when user is logged in

Please can you help fix this issue ASAP
Here the error keeps happening


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:62:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/auth.js:60:24)
at async C:\Baalak Project\ott-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63251 {
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:143:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/auth0-session/handlers/callback.js:43:29)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/callback.js:59:13)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/auth.js:60:24)
at async C:\Baalak Project\ott-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63251 {
error: ‘invalid_grant’,
errorDescription: ‘Failed to verify code verifier’,
status: 400,
statusCode: 400,
openIdState: { returnTo: ‘http://localhost:3000/ 1’ }
},
status: 400
}
1 Like

I have the same issue, but only in Webkit based (Safari-like) browsers. Is this the case for you too?

1 Like

Lots of problems with this SDK. I haven’t been able to get it working in months. I bet a lot of devs are finding other solutions because of it. I’m about to.

1 Like

I have been able to reproduce this issue with the auth0-nextjs sample app, and created an issue on the official repo. 'invalid_grant' error upon login with Safari (WebKit) · Issue #1754 · auth0/nextjs-auth0 · GitHub