lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
40.95k stars 9.34k forks source link

[Request] logto 切换为mail注册后因为无username传入数据库,可以加入一个mail 作为标识嘛? #3749

Open yelc66 opened 2 weeks ago

yelc66 commented 2 weeks ago

🥰 需求描述

image

🧐 解决方案

或是可以设置哪里解决这个问题嘛

📝 补充信息

No response

lobehubbot commented 2 weeks ago

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


🥰 Description of requirements

image

🧐 Solution

Or where can I set up to solve this problem?

📝 Supplementary information

No response

lobehubbot commented 2 weeks ago

👀 @yelc66

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

cy948 commented 1 week ago

如果用户有name信息,也会进行显示。 你可以对用户的name信息进行更改。至于能否生效还要看 #3774 实现。 此处显示的判断逻辑: https://github.com/lobehub/lobe-chat/blob/0c4efe4b33f6f26f5b2c4d3b48e8e9c9ccac8fdf/src/store/user/slices/auth/selectors.ts#L9-L15

LogtoProvider的处理: https://github.com/lobehub/lobe-chat/blob/3f92adc8e3ddac0475e22cb5c2d49f7d2e533e35/src/libs/next-auth/sso-providers/logto.ts#L22-L30

arvinxx commented 1 week ago

@cy948 我感觉应该参考下 generic-oidc 的实现,name 那边用 name: profile.name ?? profile.username ?? profile.email

https://github.com/lobehub/lobe-chat/blob/main/src/libs/next-auth/sso-providers/generic-oidc.ts#L27-L34

lobehubbot commented 1 week ago

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


@cy948 I think we should refer to the implementation of generic-oidc. For name, use name: profile.name ?? profile.username ?? profile.email