Skip to content
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

[Bug] logto用户注册后,报错 #4834

Closed
zhangnanchao opened this issue Nov 29, 2024 · 22 comments
Closed

[Bug] logto用户注册后,报错 #4834

zhangnanchao opened this issue Nov 29, 2024 · 22 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@zhangnanchao
Copy link

📦 部署环境

Docker

📌 软件版本

lobehub/lobe-chat-database:latest

💻 系统环境

Other Linux

🌐 浏览器

Chrome

🐛 问题描述

1732864483260
iShot_2024-11-29_15 15 20

📷 复现步骤

env
iShot_2024-11-29_15 20 35
docker
image
nginx
image
image
logto
image

🚦 期望结果

用户注册后 页面报错,返回主页再点用户登陆,页面还是报错,去logto控制台删除该用户后,再去点登陆页面恢复正常,但是始终无法登陆

📝 补充信息

No response

@zhangnanchao zhangnanchao added the 🐛 Bug Something isn't working | 缺陷 label Nov 29, 2024
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Nov 29, 2024
@lobehubbot
Copy link
Member

👀 @zhangnanchao

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Nov 29, 2024

@zhangnanchao Hello there! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 🤖

I found a similar discussion regarding Logto login issues in the lobe-chat repository. The discussion is titled "请问 logto 登录的问题,可否帮忙看下,下面提供了具体的配置" and it was last updated on September 30, 2024. The suggested solution in a related closed issue was to configure the NEXTAUTH_URL variable according to the documentation [1].

For your specific issue with user registration and login errors after using Logto, ensure that all environment variables are correctly set, especially those related to Logto and authentication. Here are some key variables to check:

  • AUTH_LOGTO_ID: Ensure this is set to the correct Client ID from your Logto application.
  • AUTH_LOGTO_SECRET: Ensure this is set to the correct Client Secret from your Logto application.
  • AUTH_LOGTO_ISSUER: This should be set to the correct OpenID Connect issuer URL.
  • NEXTAUTH_URL: This should be set to the correct callback URL, such as https://lobe.example.com/api/auth.

Additionally, verify that your Logto application is configured with the correct redirect URIs and CORS settings as outlined in the documentation [2]. If the problem persists, double-check your Docker and Nginx configurations to ensure they align with the expected setup for the lobe-chat application.

To continue talking to Dosu, mention @dosu.

@zhangnanchao
Copy link
Author

@zhangnanchao大家好!我来这里是为了帮助您解决错误、问题并成为贡献者。让我们一起解决这些错误吧!🤖

I found a similar discussion regarding Logto login issues in the lobe-chat repository. The discussion is titled "请问 logto 登录的问题,可否帮忙看下,下面提供了具体的配置" and it was last updated on September 30, 2024. The suggested solution in a related closed issue was to configure the NEXTAUTH_URL variable according to the documentation [1].

对于使用 Logto 后用户注册和登录错误的具体问题,请确保所有环境变量均已正确设置,尤其是与 Logto 和身份验证相关的环境变量。以下是需要检查的一些关键变量:

  • AUTH_LOGTO_ID:确保将其设置为 Logto 应用程序中的正确客户端 ID。
  • AUTH_LOGTO_SECRET:确保将其设置为 Logto 应用程序中的正确客户端密钥。
  • AUTH_LOGTO_ISSUER:这应该设置为正确的 OpenID Connect 发行者 URL。
  • NEXTAUTH_URL:这应该设置为正确的回调URL,例如https://lobe.example.com/api/auth

此外,请验证您的 Logto 应用程序是否配置了正确的重定向 URI 和 CORS 设置,如文档[2]中所述。如果问题仍然存在,请仔细检查您的 Docker 和 Nginx 配置,以确保它们与 lobe-chat 应用程序的预期设置一致。

要继续与Dosu交谈,请提及@dosu

非常感谢,并没有解决我的问题

@zhangnanchao
Copy link
Author

@zhangnanchao大家好!我来这里是为了帮助您解决错误、问题并成为贡献者。让我们一起解决这些错误吧!🤖

I found a similar discussion regarding Logto login issues in the lobe-chat repository. The discussion is titled "请问 logto 登录的问题,可否帮忙看下,下面提供了具体的配置" and it was last updated on September 30, 2024. The suggested solution in a related closed issue was to configure the NEXTAUTH_URL variable according to the documentation [1].

对于使用 Logto 后用户注册和登录错误的具体问题,请确保所有环境变量均已正确设置,尤其是与 Logto 和身份验证相关的环境变量。以下是需要检查的一些关键变量:

  • AUTH_LOGTO_ID:确保将其设置为 Logto 应用程序中的正确客户端 ID。
  • AUTH_LOGTO_SECRET:确保将其设置为 Logto 应用程序中的正确客户端密钥。
  • AUTH_LOGTO_ISSUER:这应该设置为正确的 OpenID Connect 发行者 URL。
  • NEXTAUTH_URL:这应该设置为正确的回调URL,例如https://lobe.example.com/api/auth

此外,请验证您的 Logto 应用程序是否配置了正确的重定向 URI 和 CORS 设置,如文档[2]中所述。如果问题仍然存在,请仔细检查您的 Docker 和 Nginx 配置,以确保它们与 lobe-chat 应用程序的预期设置一致。

要继续与Dosu交谈,请提及@dosu

image 已经设置 cors了

@arvinxx
Copy link
Contributor

arvinxx commented Nov 29, 2024

@cy948#4826 是否有关系?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Are @cy948 and #4826 related?

@cy948
Copy link
Contributor

cy948 commented Nov 29, 2024

@cy948#4826 是否有关系?

这个错误和 #4826 中删除 redirectUrl 没有关系,但可以在这个 pr 中加入日志打印。不打印的话基本没法解决定位当前 issue 的问题。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Are @cy948 and #4826 related?

This error has nothing to do with the deletion of redirectUrl in #4826, but log printing can be added to this PR. Without printing, it is basically impossible to solve the problem of locating the current issue.

@cy948
Copy link
Contributor

cy948 commented Nov 29, 2024

看错误描述,是 token endpoint 的响应有问题,如果你想继续使用 Logto,可以前往 /console/audit-logs 看看日志报错。我的建议是更换认证 provider 到 casdoor 。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Looking at the error description, there is a problem with the response of the token endpoint. If you want to continue using Logto, you can go to /console/audit-logs to see the log error. My suggestion is to change the authentication provider to casdoor.

@cy948
Copy link
Contributor

cy948 commented Nov 29, 2024

看看这个设置的 refresh token 开关有没有打开
image

@zhangnanchao
Copy link
Author

看看这个设置的刷新令牌开关有没有打开 图像

这个打开了

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Check whether the refresh token switch of this setting is turned on ![Image](https://private-user-images.githubusercontent.com/67412196/391150166-bbc691ed-1be8-454e-be9d -ab5307613c54.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF 3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI5NTI1NTgsIm5iZiI6MTczMjk1MjI1OCwic GF0aCI6Ii82NzQxMjE5Ni8zOTExNTAxNjYtYmJjNjkxZWQtMWJlOC00NTRlLWJlOWQtYWI1MzA3NjEzYzU0LnBuZz9YLUFtei1 BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExM zAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTMwVDA3MzczOFomWC1BbXotRXhwaXJ lcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0NTEyNzNhYzk1OTYwNWIzMWRlNTU5NzBhMWM4NDVjZGE4MWEzOWU0OGRiNWUyM2ZmM DdhMzU3MWExNTU5MGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2N9au5AEboHCOey5hz55ZKgv7LK2HYevY-cFW8SY904)

This is open

@cy948
Copy link
Contributor

cy948 commented Dec 5, 2024

等待 #4826 合并后使用新版本的 debug 模式再进行排错吧。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Wait for #4826 to be merged and use the new version of debug mode to troubleshoot.

@cy948
Copy link
Contributor

cy948 commented Dec 7, 2024

logto的ssl证书是自签名吗?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is logto's SSL certificate self-signed?

@zhangnanchao
Copy link
Author

logto的ssl证书是自签名吗?

不是 ,是阿里云颁发的,我现在用的casdoor ,是可以用的

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is logto's SSL certificate self-signed?

No, it was issued by Alibaba Cloud. The casdoor I am using now can be used.

@cy948
Copy link
Contributor

cy948 commented Dec 9, 2024

那先用着 Casdoor 吧

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Let’s use Casdoor first.

@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Dec 11, 2024
@lobehubbot
Copy link
Member

@zhangnanchao

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Archived in project
Development

No branches or pull requests

4 participants