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

🐛 fix: Disable clerk signup when env set #3126

Merged
merged 9 commits into from
Jul 7, 2024

Conversation

vegetablesB
Copy link
Contributor

@vegetablesB vegetablesB commented Jul 2, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • ⚡️ perf
  • 📝 docs

🔀 变更说明 | Description of Change

Update middle ware and page to redirect, update layout to disable the footer

环境变量是 NEXT_PUBLIC_DISABLE_CLERK_SIGN_UP

📝 补充信息 | Additional Information

相关issue:

SCR-20240702-jnbl SCR-20240702-jmzi

Copy link

vercel bot commented Jul 2, 2024

@vegetablesB is attempting to deploy a commit to the LobeHub Pro Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @vegetablesB

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@arvinxx
Copy link
Contributor

arvinxx commented Jul 2, 2024

我建议使用 Feature Flag 而不是环境变量: https://lobehub.com/zh/docs/self-hosting/advanced/feature-flags

禁用的话,配置 -clerk_sign_up

@vegetablesB
Copy link
Contributor Author

我建议使用 Feature Flag 而不是环境变量: https://lobehub.com/zh/docs/self-hosting/advanced/feature-flags

禁用的话,配置 -clerk_sign_up

修改了feature flag,请再review一下.

现在使用的是-clerk_sign_up来禁用clerk 的注册.

  • 注册footer消失
  • 如果访问/signup 也会转到login.

但是无法禁用使用accounts.xxx.com的注册页面.

src/layout/AuthProvider/Clerk/index.tsx Outdated Show resolved Hide resolved
src/config/auth.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外 SSO 登录暂时禁止不了对吧?

src/layout/AuthProvider/Clerk/index.tsx Outdated Show resolved Hide resolved
@arvinxx arvinxx changed the title feat: Disable clerk signup when env set 🐛 fix: Disable clerk signup when env set Jul 3, 2024
@vegetablesB
Copy link
Contributor Author

另外 SSO 登录暂时禁止不了对吧?

是的SSO登陆注册禁止不了,也只能在clerk关掉sso了.
试了一下,在login时登陆没有注册的google 账户, 会转到accounts.xxx.com/user, 然后退回来就可以看到登陆成功了.

目前只是footer 不显示, 和/signup 会转到/login. 用户还是可以使用accounts.xxx.com 来注册.

@lobehubbot
Copy link
Member

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


In addition, SSO login cannot be disabled temporarily, right?

Yes, SSO login and registration cannot be disabled, and SSO can only be turned off at clerk.
I tried it. When logging in to an unregistered Google account, it will go to accounts.xxx.com/user, and then return to see that the login is successful.

Currently, only the footer is not displayed, and /signup will be redirected to /login. Users can still use accounts.xxx.com to register.

@vegetablesB vegetablesB requested a review from arvinxx July 3, 2024 23:18
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.96%. Comparing base (6c4c8f7) to head (b88fb6c).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3126    +/-   ##
========================================
  Coverage   93.96%   93.96%            
========================================
  Files         388      388            
  Lines       24149    24155     +6     
  Branches     1793     2756   +963     
========================================
+ Hits        22692    22698     +6     
  Misses       1457     1457            
Flag Coverage Δ
app 93.96% <100.00%> (+<0.01%) ⬆️
server 68.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arvinxx
Copy link
Contributor

arvinxx commented Jul 4, 2024

修下测试

@lobehubbot
Copy link
Member

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


Fix the test

Copy link

vercel bot commented Jul 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 7, 2024 2:42am

@lobehubbot
Copy link
Member

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


The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 7, 2024 2:22am

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks for your contribution!

@arvinxx arvinxx merged commit 4ead315 into lobehub:main Jul 7, 2024
6 of 7 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @vegetablesB ❤️

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.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Jul 7, 2024
### [Version&nbsp;1.2.12](v1.2.11...v1.2.12)
<sup>Released on **2024-07-07**</sup>

#### 🐛 Bug Fixes

- **misc**: Fixed mobile web page navigation issue with inbox assistant, support to disable clerk signup with feature flag.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fixed mobile web page navigation issue with inbox assistant, closes [#2693](#2693) ([4476a5e](4476a5e))
* **misc**: Support to disable clerk signup with feature flag, closes [#3126](#3126) ([4ead315](4ead315))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.2.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jul 7, 2024
### [Version&nbsp;1.45.8](v1.45.7...v1.45.8)
<sup>Released on **2024-07-07**</sup>

#### 🐛 Bug Fixes

- **misc**: Fixed mobile web page navigation issue with inbox assistant, support to disable clerk signup with feature flag.

#### 💄 Styles

- **misc**: Update deepseek max token.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fixed mobile web page navigation issue with inbox assistant, closes [lobehub#2693](https://github.com/bentwnghk/lobe-chat/issues/2693) ([4476a5e](4476a5e))
* **misc**: Support to disable clerk signup with feature flag, closes [lobehub#3126](https://github.com/bentwnghk/lobe-chat/issues/3126) ([4ead315](4ead315))

#### Styles

* **misc**: Update deepseek max token, closes [lobehub#3143](https://github.com/bentwnghk/lobe-chat/issues/3143) ([4a241b9](4a241b9))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@vegetablesB vegetablesB deleted the disable-clerk-signup branch July 12, 2024 23:46
Mingholy pushed a commit to Mingholy/lobe-chat that referenced this pull request Jul 16, 2024
* feat: Disable signup when env set

* feat: Disable Clerk sign-up based on feature flag

* fix: change to client

* fix: remove the logic for signup in middleware

* chore: revert the space deletion

* fix: update the url for login and signup

* fix: fix footerAction update logic

* test: update test for enableClerkSignUp
Mingholy pushed a commit to Mingholy/lobe-chat that referenced this pull request Jul 16, 2024
### [Version&nbsp;1.2.12](lobehub/lobe-chat@v1.2.11...v1.2.12)
<sup>Released on **2024-07-07**</sup>

#### 🐛 Bug Fixes

- **misc**: Fixed mobile web page navigation issue with inbox assistant, support to disable clerk signup with feature flag.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fixed mobile web page navigation issue with inbox assistant, closes [lobehub#2693](lobehub#2693) ([4476a5e](lobehub@4476a5e))
* **misc**: Support to disable clerk signup with feature flag, closes [lobehub#3126](lobehub#3126) ([4ead315](lobehub@4ead315))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
ipoly pushed a commit to ipoly/lobe-chat that referenced this pull request Jul 29, 2024
* feat: Disable signup when env set

* feat: Disable Clerk sign-up based on feature flag

* fix: change to client

* fix: remove the logic for signup in middleware

* chore: revert the space deletion

* fix: update the url for login and signup

* fix: fix footerAction update logic

* test: update test for enableClerkSignUp
ipoly pushed a commit to ipoly/lobe-chat that referenced this pull request Jul 29, 2024
### [Version&nbsp;1.2.12](lobehub/lobe-chat@v1.2.11...v1.2.12)
<sup>Released on **2024-07-07**</sup>

#### 🐛 Bug Fixes

- **misc**: Fixed mobile web page navigation issue with inbox assistant, support to disable clerk signup with feature flag.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fixed mobile web page navigation issue with inbox assistant, closes [lobehub#2693](lobehub#2693) ([4476a5e](lobehub@4476a5e))
* **misc**: Support to disable clerk signup with feature flag, closes [lobehub#3126](lobehub#3126) ([4ead315](lobehub@4ead315))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants