-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
🐛 fix: support webhooks for logto #3774
Conversation
@cy948 is attempting to deploy a commit to the LobeHub Pro Team on Vercel. A member of the Team first needs to authorize it. |
👍 @cy948 Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3774 +/- ##
========================================
Coverage 91.85% 91.85%
========================================
Files 459 459
Lines 30759 30761 +2
Branches 2121 2963 +842
========================================
+ Hits 28254 28256 +2
Misses 2505 2505
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
动作真快🤗 |
It’s so fast 🤗 |
期待!!!!同时期待拥有一个logto的用户面板功能,没有用户面板的话用户修改密码等操作就无法在lobehub内完成,只能由logto管理员前往logto操作! |
Looking forward to it!!!! Also looking forward to having a logto user panel function. Without the user panel, operations such as changing passwords cannot be completed in lobehub. Logto administrators can only go to logto for operations! |
行动确实很快 |
Acts really fast |
这个得看下 logto 有没有这个 UI 组件了 |
This depends on whether logto has this UI component. |
9c82fdd
to
975ad53
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
这个 PR 我看已经合并了,可以应用了吗 |
I see this PR has been merged. Can it be applied? |
❤️ Great PR @cy948 ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
### [Version 1.16.11](v1.16.10...v1.16.11) <sup>Released on **2024-09-12**</sup> #### 🐛 Bug Fixes - **misc**: Support webhooks for logto. #### 💄 Styles - **misc**: Default disable mistral provider useless models. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **misc**: Support webhooks for logto, closes [#3774](#3774) ([0cfee6b](0cfee6b)) #### Styles * **misc**: Default disable mistral provider useless models, closes [#3922](#3922) ([bdbc647](bdbc647)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 1.16.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
具体如何使用,readme更新了吗 |
How to use it specifically? Has the readme been updated? |
@VectorZhao 简单文档在pr描述那里,图文的readme要等 @zhuozhiyongde 大佬有空再做。 |
@VectorZhao The simple document is in the PR description, and the readme with pictures and text will have to wait until @zhuozhiyongde is free. |
谢谢,试了一下,.env增加环境变量 |
@VectorZhao 你说的这个hook不在实现范围内,目前只实现了用户信息更新。 |
@VectorZhao The hook you mentioned is not within the scope of implementation. Currently, only user information update is implemented. |
logto中创建了一个用户,lobe登录。logto修改了该用户的用户名,然后lobe退出再登录。目前的webhooks会更新用户名吗?我试了下lobe 退出再登录还是之前的用户名,没有更新成logto修改后的用户名 |
A user is created in logto, lobe logs in. logto modifies the user's username, then lobe logs out and logs in again. Will the current webhooks update the username? I tried lobe to log out and log in again, it was still the previous username, but it was not updated to the username modified by logto. |
@VectorZhao 只有 name email avatar 会更新,username 不在范围内。 |
@VectorZhao Only name email avatar will be updated, username is not in the scope. |
谢谢耐心解答,了解了 |
Thank you for your patience in answering, I understand. |
## [Version 1.60.0](v1.59.4...v1.60.0) <sup>Released on **2024-09-13**</sup> #### ♻ Code Refactoring - **misc**: Support Environment Variable Inference For NextAuth. #### ✨ Features - **misc**: Support openai new OpenAI o1-preview/o1-mini models. #### 🐛 Bug Fixes - **misc**: Qwen model param error, support webhooks for logto. #### 💄 Styles - **model**: Remove `OpenAI` deprecated model. - **misc**: Default disable mistral provider useless models, Remove brackets from model names with dates in OpenAI, Support Google Model List, Update siliconcloud model. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Support Environment Variable Inference For NextAuth, closes [lobehub#3701](https://github.com/bentwnghk/lobe-chat/issues/3701) ([b956755](b956755)) #### What's improved * **misc**: Support openai new OpenAI o1-preview/o1-mini models, closes [lobehub#3943](https://github.com/bentwnghk/lobe-chat/issues/3943) ([61bfeb2](61bfeb2)) #### What's fixed * **misc**: Qwen model param error, closes [lobehub#3902](https://github.com/bentwnghk/lobe-chat/issues/3902) ([c9f00e5](c9f00e5)) * **misc**: Support webhooks for logto, closes [lobehub#3774](https://github.com/bentwnghk/lobe-chat/issues/3774) ([0cfee6b](0cfee6b)) #### Styles * **model**: Remove `OpenAI` deprecated model, closes [lobehub#3465](https://github.com/bentwnghk/lobe-chat/issues/3465) ([68a4fb2](68a4fb2)) * **misc**: Default disable mistral provider useless models, closes [lobehub#3922](https://github.com/bentwnghk/lobe-chat/issues/3922) ([bdbc647](bdbc647)) * **misc**: Remove brackets from model names with dates in OpenAI, closes [lobehub#3927](https://github.com/bentwnghk/lobe-chat/issues/3927) ([2a937bc](2a937bc)) * **misc**: Support Google Model List, closes [lobehub#3938](https://github.com/bentwnghk/lobe-chat/issues/3938) ([be4efc7](be4efc7)) * **misc**: Update siliconcloud model, closes [lobehub#3935](https://github.com/bentwnghk/lobe-chat/issues/3935) ([882e981](882e981)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
* ✨ feat: support webhooks for logto * :sparles: feat: update more info * ♻️ refactor: allow edit more info by webhook * ♻️ refactor: rename `nextauthUser` to `nextAuthUser` * 🧪 test: + webhooks trigger --------- Co-authored-by: Arvin Xu <arvinx@foxmail.com>
### [Version 1.16.11](lobehub/lobe-chat@v1.16.10...v1.16.11) <sup>Released on **2024-09-12**</sup> #### 🐛 Bug Fixes - **misc**: Support webhooks for logto. #### 💄 Styles - **misc**: Default disable mistral provider useless models. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **misc**: Support webhooks for logto, closes [lobehub#3774](lobehub#3774) ([0cfee6b](lobehub@0cfee6b)) #### Styles * **misc**: Default disable mistral provider useless models, closes [lobehub#3922](lobehub#3922) ([bdbc647](lobehub@bdbc647)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
src/app/api/webhooks/logto/validateRequest.ts
: 按照Logto文档验证签名src/app/api/webhooks/logto/route.ts
: 处理Logto event。目前支持的 event 有:User.Data.Updated
;src/app/api/webhooks/logto/__tests__/route.test.ts
: 添加一个易于本地测试 webhook 的 test case。仅为local dev准备,ci时会跳过该 case。close #3722
📝 补充信息 | Additional Information
node:crypto
,只能使用 node 环境运行;/console/webhooks
中创建一个webhookUser.Data.Update
https://<your_domain>/api/webhooks/logto
LOGTO_WEBHOOK_SIGNING_KEY
传入src/app/api/webhooks/logto/__tests__/route.test.ts
: 将describe.skip
替换为describe
,将userDataUpdatedEvent
中的信息替换为测试数据;麻烦 @zhuozhiyongde 大佬在文档里补充一下 logto 的webhook接入操作🥺。操作在上面的《使用方式》一栏了。