Next.js集成Google Provider时遭遇OAuthSignin错误求助
Google OAuth登录报错:signin?error=OAuthSignin
- 登录时触发错误,跳转至
signin?error=OAuthSignin,页面提示“try signing in with a different account” - 控制台错误截图地址:https://i.sstatic.net/JXouZ.png
当前配置信息
NextAuth.js Google Provider 代码配置
providers: [ GoogleProvider({ clientId: process.env.GOOGLE_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, }) ],
.env 文件内容
GOOGLE_ID = string.apps.googleusercontent.com GOOGLE_CLIENT_SECRET = string
已尝试的无效操作
- 给
.env文件中GOOGLE_ID的值添加引号(如GOOGLE_ID = "stuff"),问题未解决 - 查阅相关资料,仍未找到可行解决方案,恳请指导
内容的提问来源于stack exchange,提问作者Halden
相关产品推荐
相关产品推荐

