I m是关于我的联合材料全面课程的项目,I m与下乌斯特谷歌提供者讨论一些问题(第4.18.8章)。
今天早上,所有工作都很出色。 在与Google提供商取得成功标识后,使用“使用Session()”使谷歌的证书在奥索尔。 标志,我全心全意,走到吉姆。 在我回头之后(当然抽出一个显示器),我将获得这些 go光证书,在首页上显示用户名称,但令我感到惊讶的是,我开始看到这一警示错误。
FYI, env. local is interprety set up with GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. 我甚至删除了我关于谷歌的全权证书,并创建了另一个测试证书,但没有幸运。
在试图登录时,我发现这一错误:
[next-auth][error][OAUTH_CALLBACK_ERROR]
https://next-auth.js.org/errors#oauth_callback_error checks.state argument is missing {
error: TypeError: checks.state argument is missing
at Client.callback (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modulesopenid-clientlibclient.js:387:13)
at oAuthCallback (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
ext-authcoreliboauthcallback.js:127:29)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.callback (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
ext-authcore
outescallback.js:52:11)
at async AuthHandler (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
ext-authcoreindex.js:201:28)
at async NextAuthHandler (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
ext-auth
extindex.js:23:19)
at async C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
ext-auth
extindex.js:59:32
at async Object.apiResolver (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserverapi-utils
ode.js:363:9)
at async DevServer.runApi (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserver
ext-server.js:487:9)
at async Object.fn (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserver
ext-server.js:749:37)
at async Router.execute (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserver
outer.js:253:36)
at async DevServer.run (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserverase-server.js:384:29)
at async DevServer.run (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserverdev
ext-dev-server.js:741:20)
at async DevServer.handleRequest (C:JoãoDropboxPessoalProjetos Webdesign rading-center
ode_modules
extdistserverase-server.js:322:20) {
name: OAuthCallbackError ,
code: undefined
},
providerId: google ,
message: checks.state argument is missing
在我的谷歌账户点击后,我注意到一些东西,涉及我的DevTools网络:
First, it will make a request that returns status code 302 on "consent?authuser=0&part=......." After that, another request to "google?state=......" returns 302 also. Then I get an error on request to http://127.0.0.1:3000/api/auth/error?error=OAuthCallback also with 302 status code. Finally, I get an error on request to http://127.0.0.1:3000/api/auth/signin?error=OAuthCallback that returns 404
我不理解这一点,但我很相信,我无意对这些要求产生302个错误。
我的法典就是这样。
www.un.org/Depts/DGACM/index_spanish.htm 我有一个叫作这一职能的纽子:。
const handleGoogleLogin = async () => {
await signIn( google , {
redirect: true,
callbackUrl: http://127.0.0.1:3000/user/dashboard
})
}
www.un.org/Depts/DGACM/index_spanish.htm My [...nextauth].js file:
export const authOptions = {
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET
})
],
session: {
strategy: "jwt",
},
jwt: {
secret: process.env.JWT_TOKEN
},
adapter: MongooseAdapter(process.env.MONGODB_URI),
}
export default NextAuth(authOptions)
见我。
如果你认为有必要,我可以自由地向我提问。
Greatly appreciated.
João Textor