-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
InvalidCheck: pkceCodeVerifier value could not be parsed. (Oath Provider Error) #12345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same issue here, using Next.js 15.1.0 & React 19. Sometimes works, sometimes doesn't with the above stated error. |
I encountered the same issue as you described with Next 15.1 and React 19.0. If you’ve found any potential workarounds or additional details since your post, I’d appreciate it if you could share them here! |
I also encountered the same error. In my case, I used Chrome's incognito mode to log in and found that the error disappeared. |
I have the same issue with Notion, using these versions:
|
I have the same issue. I get this error when I try to log in using google provider.
I use,
|
This comment has been minimized.
This comment has been minimized.
well downgraded to next 14.2.20 and next auth beta to 5.0.0-beta.20 and everything if fixed and also clear your cookies as well. |
Doing this did not solve the issue for me. |
Same here. Issue still exists |
Also experiencing the same issue. It occurs randomly on sign in. Some sign-ins work, some throw this exact error. |
Same happening for me using the Cognito provider. Works most of the time but getting these errors in the logs and some users saying they can't log in. Please let me know if there's any other info I can provide to help out.
|
I got this error today, and I don't know if it helps, but for me, the reason was that I was subscribing to the pkceCodeVerifier cookie, and the SameSite attribute was set to None. So, I followed the documentation and set it to Lax, and it worked for me. |
This error is happening to me, React 19 & Next.js 15.. Can we get an update on this? |
Also happening to me, also on Next.js 15. |
Just happened to me as well. React 19, Next.js 15.2.0-canary.19 and next-auth 5.0.0-beta.25. |
It's the same to me. I was using next-auth 5.0.0-beta-25 and even after downgrading to next-aht 5.0.0-beta-20 the issues still exist. |
This comment has been minimized.
This comment has been minimized.
why is this issue closed, it's still not get solved i'm also facing this issue. |
Am having same issue with latest version. Github auth works, Google auth doesnt |
Hi all, I fixed it, at least for my use case. My system uses auth.js only to handle stuff like JWT, callbacks, etc. I am using Google provider to get the access_token and then send it to my backend auth service (where JWT is generated and sent back to the front end). The callback URL in my backend is configured to send the Google info (after a successful login) to a "www" subdomain. It is important to note here that the callback URL must be the same on Google API console. The problem arises when user tries to login using the non-www subdomain, which is not configured as callback in my backend. To fix the error I routed all non-www traffic to a www subdomain in my Nginx web server. Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks! |
I met this error in the Auth.js turorial. This is my solution. I set clientId and clientSecret like this. import NextAuth from "next-auth" export const { handlers, auth } = NextAuth({ And add localhost in OAuth 2.0 in Google Console, |
if you submitted your callback in google console as (http://localhost:3000/api/auth/callback/google) it is important to know its only for LOCALHOST dont visit your page as (http://192.168.1.7:3000) visit it as (http://localhost:3000) if you dont you will get pkceCodeVerifier error (next 15, react 19) |
well the issue still present in latest version on Next Js 15.2.3 and Auth 5.0.0-beta.25 this time i can't downgrade anyone here find any fix for this. |
I didn't know the difference between latest version and next.auth. |
I was running into this error with the Google provider after setting Long story short, I had set This was an oversight on my part. The docs for "Securing a preview deployment" clearly state:
|
In my case, it happened because:
For cases 1 and 2, I did the following to resolve it with a retry.
Keep in mind that you'll need to create your own error handling page: /auth/error/page.tsx |
Provider type
GitHub, Google
Environment
System:
OS: macOS 15.1.1
CPU: (8) arm64 Apple M2
Memory: 305.41 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.1.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.8.3 - /opt/homebrew/bin/npm
bun: 1.1.38 - /opt/homebrew/bin/bun
Browsers:
Chrome: 131.0.6778.108
Safari: 18.1.1
npmPackages:
@auth/prisma-adapter: ^2.7.4 => 2.7.4
next: 15.0.3 => 15.0.3
next-auth: ^5.0.0-beta.25 => 5.0.0-beta.25
react: 19.0.0-rc-66855b96-20241106 => 19.0.0-rc-66855b96-20241106
Reproduction URL
https://github.com/Lucifer472/slack-clone
Describe the issue
[auth][error] InvalidCheck: pkceCodeVerifier value could not be parsed. Read more at https://errors.authjs.dev#invalidcheck
at parseCookie (/Users/truepubmedia/Desktop/sites/slack-clone/.next/server/chunks/e044d_@auth_core_d1f52f..js:3030:15)
at Object.use (/Users/truepubmedia/Desktop/sites/slack-clone/.next/server/chunks/e044d@auth_core_d1f52f..js:3058:30)
at handleOAuth (/Users/truepubmedia/Desktop/sites/slack-clone/.next/server/chunks/e044d@auth_core_d1f52f..js:3288:247)
at async Module.callback (/Users/truepubmedia/Desktop/sites/slack-clone/.next/server/chunks/e044d@auth_core_d1f52f..js:3782:41)
at async AuthInternal (/Users/truepubmedia/Desktop/sites/slack-clone/.next/server/chunks/e044d@auth_core_d1f52f..js:4859:24)
at async Auth (/Users/truepubmedia/Desktop/sites/slack-clone/.next/server/chunks/e044d@auth_core_d1f52f._.js:5120:34)
at async AppRouteRouteModule.do (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:10:33313)
at async AppRouteRouteModule.handle (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:10:40382)
at async doRender (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:1455:42)
at async responseGenerator (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:1814:28)
at async DevServer.renderToResponseWithComponentsImpl (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:1824:28)
at async DevServer.renderPageComponent (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:2240:24)
at async DevServer.renderToResponseImpl (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:2278:32)
at async DevServer.pipeImpl (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:960:25)
at async NextNodeServer.handleCatchallRenderRequest (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/next-server.js:281:17)
at async DevServer.handleRequestImpl (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/base-server.js:853:17)
at async /Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/dev/next-dev-server.js:373:20
at async Span.traceAsyncFn (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/trace/trace.js:153:20)
at async DevServer.handleRequest (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/dev/next-dev-server.js:370:24)
at async invokeRender (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/lib/router-server.js:183:21)
at async handleRequest (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/lib/router-server.js:360:24)
at async requestHandlerImpl (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/lib/router-server.js:384:13)
at async Server.requestListener (/Users/truepubmedia/Desktop/sites/slack-clone/node_modules/next/dist/server/lib/start-server.js:142:13)
Credentials Provider works like charm without any issues but Oath Providers are not working all the give the same error i tried different ways to sort it out but nothing works. i think the issue is with latest version on next js and prisma because i tried going to past version but same issue also the same config works perfectly fine in next js 14 i tried that
How to reproduce
Just clone the repo and added github client id and secret in env file also connect a database
Expected behavior
Github provider should redirect to authorized page then logged in to App.
The text was updated successfully, but these errors were encountered: