Closed ilovelxy closed 2 hours ago
👀 @ilovelxy
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
Hey there, @ilovelxy! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's squash this bug together!
I found a similar issue that might be related to the problem you're experiencing. The issue titled "[Bug] docker部署时next-auth不可用" was closed and suggested configuring the NEXTAUTH_URL
variable according to the documentation [1].
For your specific issue with the client_id=undefined
error, ensure that your .env
file is correctly configured with the necessary environment variables. Here are the steps you should follow:
Check Environment Variables:
AUTH_GITHUB_ID
and AUTH_GITHUB_SECRET
are correctly set in your .env
file. These should be the Client ID and Client Secret from your GitHub OAuth application.NEXTAUTH_URL
is set to the correct callback URL, which should match the one configured in your GitHub app (http://localhost:3210/api/auth/callback/github
).GitHub OAuth Application Configuration:
NEXTAUTH_URL
in your .env
file.Generate a Secret:
NEXT_AUTH_SECRET
is set. You can generate a secret using a command like openssl rand -base64 32
.These steps should help resolve the client_id=undefined
error and the 404 page issue after logging in. If the problem persists, ensure that all environment variables are correctly loaded in your Docker setup.
To continue talking to Dosu, mention @dosu.
这几个步骤已经确认过了还是同样的现象
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I have confirmed these steps and still have the same phenomenon.
✅ @ilovelxy
This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。
📦 Environment
Docker
📌 Version
1.31.8
💻 Operating System
Ubuntu
🌐 Browser
Chrome
🐛 Bug Description
使用docker+nextauth部署完成后,正常进入网站点击登陆,然后输入用户名和密码,登陆后会进入一个404页面,地址栏显示
https://github.com/login/oauth/authorize?client_id=undefined&code_challenge=oPEiL2Nx3hBn......
.env文件中的设置是:
github app中配置好了回调地址是:
http://localhost:3210/api/auth/callback/github
为什么会这样,是哪里设置的不对吗
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response