-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
♻️ refactor: Support Environment Variable Inference For NextAuth #3701
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 #3701 +/- ##
==========================================
+ Coverage 91.88% 91.90% +0.02%
==========================================
Files 460 460
Lines 30792 30887 +95
Branches 2965 1999 -966
==========================================
+ Hits 28293 28388 +95
Misses 2499 2499
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是以 Auth0 为试点还是怎么说?
@arvinxx 目前以 auth0 做一个示例,展示一下这个工作大概流程: 添加兼容旧环境变量的代码、添加废弃的warning、等迁移期过了之后移除标记的代码这样。 |
@arvinxx is currently using auth0 as an example to show the general workflow: add code that is compatible with old environment variables, add obsolete warnings, and remove the marked code after the migration period. |
@cy948 如果要包含示例的话,是不是应该还需要加文档? |
@cy948 If you want to include examples, should you also need to add documentation? |
是的,应该添加 sso provider 的接入文档 |
Yes, the access document of the sso provider should be added |
f19e091
to
2d7b44a
Compare
环境变量文档的修改就拜托天才文档man @zhuozhiyongde 完成,这里是一些可能有帮助的信息:
|
3448d15
to
f6904a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我记得还有一个 NEXTAUTH_URL,这个改了么
这个变量是 authjs 内置的,我们没传入参数,所以不用改 |
This variable is built-in to authjs. We did not pass in parameters, so there is no need to change it. |
我想做成默认拼一个 APP_URL + |
I want to make a version of APP_URL + |
可以,我马上做 |
Okay, I'll do it right away |
改了一版 bdf43bd |
Changed version bdf43bd |
@cy948 补一下单测?主要验证下是否会有 warning。补好我感觉就可以合了 |
@cy948 Can you make up for the single test? Once it's patched up, I feel like it'll fit. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
d24eb1b
to
d300101
Compare
@arvinxx rebase完了,大佬再check一下? |
@arvinxx The rebase is finished, please check again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我合了,环境变量的文档还得再改一下
❤️ 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.10](v1.16.9...v1.16.10) <sup>Released on **2024-09-12**</sup> #### ♻ Code Refactoring - **misc**: Support Environment Variable Inference For NextAuth. #### 🐛 Bug Fixes - **misc**: Qwen model param error. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Support Environment Variable Inference For NextAuth, closes [#3701](#3701) ([b956755](b956755)) #### What's fixed * **misc**: Qwen model param error, closes [#3902](#3902) ([c9f00e5](c9f00e5)) </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.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [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>
…ehub#3701) * ♻️ refactor: `AUTH_SECRET`&`AUTH_TRUST_HOST` * ⬆️ chore: update nextauth & @auth/core version * ♻️ refactor: env infer for `auth0` * ⬆️ chore: always use latest `next-auth` & `@auth/core` * ♻️ refactor: align `authelia` * ♻️ refactor: align `authentik` * ♻️ align `github` * ♻️ refactor: align `azure_ad` * ♻️ refactor: align `cloudflare zero trust` * ♻️ refactor: align `generic-oidc` * ♻️ refactor: align `logto` * ♻️ refactor: align `zitadel` * ♻️ refactor: add deprecate tips * ♻️ refactor: add warning for `azure_ad` * 💄 style: reformat codes * 🐛 fix: azure warning * 🐛 fix: warning for cloudfalre zero turst * 🐛 fix: warning for generic oidc * ⏪ revert: revert changes to `NEXT_AUTH_SECRET` * ♻️ refactor: add redirectProxy url * ⏪ revert: unmodify ENABLE_NEXT_AUTH * 🧪 test: should show env warning
### [Version 1.16.10](lobehub/lobe-chat@v1.16.9...v1.16.10) <sup>Released on **2024-09-12**</sup> #### ♻ Code Refactoring - **misc**: Support Environment Variable Inference For NextAuth. #### 🐛 Bug Fixes - **misc**: Qwen model param error. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Support Environment Variable Inference For NextAuth, closes [lobehub#3701](lobehub#3701) ([b956755](lobehub@b956755)) #### What's fixed * **misc**: Qwen model param error, closes [lobehub#3902](lobehub#3902) ([c9f00e5](lobehub@c9f00e5)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
package.json
: 将next-auth
及@auth/core
更新到最新版本;src/config/auth.ts
NEXT_AUTH_SECRET
变量的废弃提醒;src/config/__tests__/auth.test.ts
: 测试是否有废弃提醒;📝 补充信息 | Additional Information
AUTH_[Provider]_[Param]
,其中Provider
为auth0,github...
,Param
为ID,SECRET,ISSUER
此类;NEXT_AUTH_SECRET
;authEnv
中读取变量,当配置中不含clientId, issuer
时next-auth才会进行env infer,示例: