最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

next.js - NextAuth State cookiePKCE code_verifier cookie missing - Stack Overflow

programmeradmin1浏览0评论

Environment

System:
    OS: macOS 15.3.2
    CPU: (8) arm64 Apple M3
    Memory: 109.34 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
  Browsers:
    Chrome: 134.0.6998.166
    Safari: 18.3.1
  npmPackages:
    @auth/mongodb-adapter: ^3.7.4 => 3.8.0 
    next: ^14.2.20 => 14.2.25 
    next-auth: ^4.24.11 => 4.24.11 
    react: 18.2.0 => 18.2.0 

Reproduction URL

Describe the issue Hello, I'm having a problem with NextAuth.

I use two providers: Google and Apple. I have one problem for each provider:

For Google: [next-auth][error][OAUTH_CALLBACK_ERROR] State cookie was missing providerId: 'google', message: 'State cookie was missing.'

For Apple: [next-auth][error][OAUTH_CALLBACK_ERROR] PKCE code_verifier cookie was missing. providerId: 'apple', message: 'PKCE code_verifier cookie was missing.'

These messages appear each time I log in to my application. It's not blocking, and users are able to log in. I'd like to understand the cause because I've already added a PKCE cookie to my next-auth.ts file. This is polluting my environment's logs, and I'd like to fix it as soon as possible.

My next-auth.ts and next-auth.d.ts files in the link Here are the versions used:

"next": "^14.2.20",
"next-auth": "^4.24.11",
"react": "18.2.0",
发布评论

评论列表(0)

  1. 暂无评论