@lobehub/lobehub 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/.env.example +4 -3
  2. package/.github/workflows/release-desktop-stable.yml +1 -1
  3. package/CHANGELOG.md +50 -0
  4. package/Dockerfile +6 -4
  5. package/README.md +3 -4
  6. package/README.zh-CN.md +3 -4
  7. package/apps/desktop/src/main/controllers/McpInstallCtr.ts +10 -10
  8. package/apps/desktop/src/main/controllers/NetworkProxyCtr.ts +6 -6
  9. package/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts +2 -2
  10. package/changelog/v2.json +14 -0
  11. package/docs/changelog/2025-03-02-new-models.mdx +1 -1
  12. package/docs/changelog/2025-03-02-new-models.zh-CN.mdx +1 -1
  13. package/docs/changelog/2025-04-06-exports.mdx +1 -1
  14. package/docs/changelog/2025-04-06-exports.zh-CN.mdx +1 -1
  15. package/docs/changelog/2025-05-08-desktop-app.mdx +2 -2
  16. package/docs/changelog/2025-05-08-desktop-app.zh-CN.mdx +2 -2
  17. package/docs/changelog/2025-06-08-claude-4.mdx +1 -1
  18. package/docs/changelog/2025-06-08-claude-4.zh-CN.mdx +1 -1
  19. package/docs/changelog/2025-07-08-mcp-market.mdx +1 -1
  20. package/docs/changelog/2025-07-08-mcp-market.zh-CN.mdx +1 -1
  21. package/docs/changelog/2025-08-08-image-generation.mdx +1 -1
  22. package/docs/changelog/2025-08-08-image-generation.zh-CN.mdx +1 -1
  23. package/docs/changelog/2025-09-08-gemini.mdx +1 -1
  24. package/docs/changelog/2025-09-08-gemini.zh-CN.mdx +1 -1
  25. package/docs/changelog/2025-10-08-python.mdx +1 -1
  26. package/docs/changelog/2025-10-08-python.zh-CN.mdx +1 -1
  27. package/docs/changelog/2025-11-08-comfy-ui.mdx +1 -1
  28. package/docs/changelog/2025-11-08-comfy-ui.zh-CN.mdx +1 -1
  29. package/docs/changelog/2025-12-20-mcp.mdx +1 -1
  30. package/docs/changelog/2025-12-20-mcp.zh-CN.mdx +1 -1
  31. package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +1 -1
  32. package/docs/development/basic/add-new-image-model.mdx +3 -3
  33. package/docs/development/basic/add-new-image-model.zh-CN.mdx +3 -3
  34. package/docs/development/basic/chat-api.mdx +10 -10
  35. package/docs/development/basic/chat-api.zh-CN.mdx +10 -10
  36. package/docs/development/basic/feature-development.mdx +4 -4
  37. package/docs/development/basic/feature-development.zh-CN.mdx +4 -4
  38. package/docs/development/basic/setup-development.mdx +4 -4
  39. package/docs/development/basic/setup-development.zh-CN.mdx +4 -4
  40. package/docs/development/internationalization/add-new-locale.mdx +1 -1
  41. package/docs/development/internationalization/add-new-locale.zh-CN.mdx +1 -1
  42. package/docs/development/internationalization/internationalization-implementation.mdx +5 -5
  43. package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +5 -5
  44. package/docs/development/others/lighthouse.mdx +8 -8
  45. package/docs/development/others/lighthouse.zh-CN.mdx +8 -8
  46. package/docs/development/start.mdx +3 -3
  47. package/docs/development/start.zh-CN.mdx +3 -3
  48. package/docs/self-hosting/advanced/feature-flags.mdx +1 -1
  49. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
  50. package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
  51. package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +2 -2
  52. package/docs/self-hosting/advanced/online-search.mdx +1 -1
  53. package/docs/self-hosting/advanced/online-search.zh-CN.mdx +1 -1
  54. package/docs/self-hosting/advanced/redis/upstash.mdx +3 -3
  55. package/docs/self-hosting/advanced/redis/upstash.zh-CN.mdx +3 -3
  56. package/docs/self-hosting/advanced/redis.mdx +6 -6
  57. package/docs/self-hosting/advanced/redis.zh-CN.mdx +6 -6
  58. package/docs/self-hosting/advanced/s3/rustfs.mdx +116 -116
  59. package/docs/self-hosting/advanced/s3/rustfs.zh-CN.mdx +116 -117
  60. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +5 -5
  61. package/docs/self-hosting/auth/email.mdx +70 -0
  62. package/docs/self-hosting/auth/email.zh-CN.mdx +70 -0
  63. package/docs/self-hosting/{advanced/auth → auth}/legacy.mdx +10 -10
  64. package/docs/self-hosting/{advanced/auth → auth}/legacy.zh-CN.mdx +5 -5
  65. package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.zh-CN.mdx +3 -3
  66. package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.zh-CN.mdx +2 -2
  67. package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.zh-CN.mdx +2 -2
  68. package/docs/self-hosting/{advanced/auth → auth}/providers/apple.mdx +6 -6
  69. package/docs/self-hosting/{advanced/auth → auth}/providers/apple.zh-CN.mdx +6 -6
  70. package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.mdx +12 -12
  71. package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.zh-CN.mdx +12 -12
  72. package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.mdx +13 -13
  73. package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.zh-CN.mdx +13 -13
  74. package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.mdx +13 -13
  75. package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.zh-CN.mdx +13 -13
  76. package/docs/self-hosting/{advanced/auth → auth}/providers/casdoor.mdx +8 -8
  77. package/docs/self-hosting/{advanced/auth → auth}/providers/casdoor.zh-CN.mdx +7 -7
  78. package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.mdx +7 -7
  79. package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.zh-CN.mdx +6 -6
  80. package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.mdx +13 -13
  81. package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.zh-CN.mdx +13 -13
  82. package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.mdx +10 -10
  83. package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.zh-CN.mdx +10 -10
  84. package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.mdx +12 -12
  85. package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.zh-CN.mdx +12 -12
  86. package/docs/self-hosting/{advanced/auth → auth}/providers/github.mdx +10 -10
  87. package/docs/self-hosting/{advanced/auth → auth}/providers/github.zh-CN.mdx +10 -10
  88. package/docs/self-hosting/{advanced/auth → auth}/providers/google.mdx +10 -10
  89. package/docs/self-hosting/{advanced/auth → auth}/providers/google.zh-CN.mdx +10 -10
  90. package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.mdx +11 -11
  91. package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.zh-CN.mdx +11 -11
  92. package/docs/self-hosting/{advanced/auth → auth}/providers/logto.mdx +8 -8
  93. package/docs/self-hosting/{advanced/auth → auth}/providers/logto.zh-CN.mdx +7 -7
  94. package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.mdx +11 -11
  95. package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.zh-CN.mdx +11 -11
  96. package/docs/self-hosting/{advanced/auth → auth}/providers/okta.mdx +13 -13
  97. package/docs/self-hosting/{advanced/auth → auth}/providers/okta.zh-CN.mdx +13 -13
  98. package/docs/self-hosting/auth/providers/password.mdx +112 -0
  99. package/docs/self-hosting/auth/providers/password.zh-CN.mdx +103 -0
  100. package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.mdx +10 -10
  101. package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.zh-CN.mdx +10 -10
  102. package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.mdx +13 -13
  103. package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.zh-CN.mdx +13 -13
  104. package/docs/self-hosting/{advanced/auth.mdx → auth.mdx} +24 -81
  105. package/docs/self-hosting/{advanced/auth.zh-CN.mdx → auth.zh-CN.mdx} +23 -80
  106. package/docs/self-hosting/environment-variables/auth.mdx +7 -0
  107. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +7 -0
  108. package/docs/self-hosting/environment-variables/basic.mdx +0 -7
  109. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
  110. package/docs/self-hosting/environment-variables/redis.mdx +1 -1
  111. package/docs/self-hosting/environment-variables/redis.zh-CN.mdx +1 -1
  112. package/docs/self-hosting/environment-variables.mdx +1 -1
  113. package/docs/self-hosting/examples/azure-openai.mdx +0 -1
  114. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
  115. package/docs/self-hosting/faq/no-v1-suffix.mdx +3 -3
  116. package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +3 -3
  117. package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.mdx +7 -7
  118. package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.zh-CN.mdx +7 -7
  119. package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.mdx +2 -2
  120. package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.zh-CN.mdx +2 -2
  121. package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.mdx +11 -11
  122. package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.zh-CN.mdx +11 -11
  123. package/docs/self-hosting/migration/v2/breaking-changes.mdx +1 -1
  124. package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +1 -1
  125. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +4 -4
  126. package/docs/self-hosting/platform/docker.mdx +5 -5
  127. package/docs/self-hosting/platform/docker.zh-CN.mdx +10 -10
  128. package/docs/self-hosting/platform/dokploy.mdx +1 -1
  129. package/docs/self-hosting/platform/dokploy.zh-CN.mdx +5 -5
  130. package/docs/self-hosting/platform/sealos.mdx +12 -12
  131. package/docs/self-hosting/platform/sealos.zh-CN.mdx +17 -17
  132. package/docs/self-hosting/platform/vercel.zh-CN.mdx +4 -4
  133. package/docs/self-hosting/start.mdx +3 -3
  134. package/docs/self-hosting/start.zh-CN.mdx +4 -4
  135. package/locales/en-US/auth.json +2 -1
  136. package/locales/en-US/authError.json +1 -0
  137. package/locales/en-US/metadata.json +1 -1
  138. package/locales/zh-CN/auth.json +1 -0
  139. package/locales/zh-CN/authError.json +1 -0
  140. package/netlify.toml +0 -1
  141. package/package.json +1 -1
  142. package/packages/types/src/serverConfig.ts +1 -0
  143. package/src/app/[variants]/(auth)/auth-error/page.tsx +4 -2
  144. package/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx +57 -50
  145. package/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx +1 -1
  146. package/src/app/[variants]/(auth)/signin/page.tsx +2 -0
  147. package/src/app/[variants]/(auth)/signin/useSignIn.ts +2 -0
  148. package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +7 -0
  149. package/src/envs/app.ts +0 -2
  150. package/src/envs/auth.ts +3 -0
  151. package/src/libs/better-auth/define-config.ts +1 -1
  152. package/src/libs/better-auth/sso/providers/feishu.ts +15 -14
  153. package/src/libs/better-auth/sso/providers/wechat.ts +6 -3
  154. package/src/libs/next/proxy/define-config.ts +1 -1
  155. package/src/locales/default/auth.ts +3 -1
  156. package/src/locales/default/authError.ts +2 -0
  157. package/src/locales/default/metadata.ts +1 -1
  158. package/src/server/globalConfig/index.ts +1 -0
  159. package/src/server/ld.ts +1 -1
  160. package/src/store/chat/slices/topic/action.ts +1 -1
  161. package/src/store/electron/actions/settings.ts +7 -7
  162. package/src/store/electron/actions/sync.ts +11 -11
  163. package/src/store/global/actions/general.ts +12 -12
  164. package/src/store/global/initialState.ts +11 -11
  165. package/src/store/global/selectors/clientDB.ts +1 -1
  166. package/src/store/global/selectors/systemStatus.ts +1 -1
  167. package/src/store/image/slices/generationConfig/action.ts +12 -12
  168. package/src/store/image/utils/size.ts +11 -11
  169. package/src/store/library/slices/ragEval/actions/dataset.ts +1 -1
  170. package/src/store/serverConfig/selectors.ts +1 -0
  171. package/src/store/session/slices/session/initialState.ts +6 -6
  172. package/src/store/session/slices/session/reducers.ts +1 -1
  173. package/src/store/session/slices/sessionGroup/initialState.ts +2 -2
  174. package/src/store/tool/slices/customPlugin/action.ts +2 -2
  175. package/src/store/tool/slices/oldStore/action.ts +5 -5
  176. package/src/store/userMemory/slices/preference/action.ts +6 -6
  177. /package/docs/self-hosting/{advanced/auth → auth}/clerk.mdx +0 -0
  178. /package/docs/self-hosting/{advanced/auth → auth}/clerk.zh-CN.mdx +0 -0
  179. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.mdx +0 -0
  180. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.zh-CN.mdx +0 -0
  181. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.mdx +0 -0
  182. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.zh-CN.mdx +0 -0
  183. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.mdx +0 -0
  184. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.zh-CN.mdx +0 -0
  185. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.mdx +0 -0
  186. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.mdx +0 -0
  187. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.zh-CN.mdx +0 -0
  188. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.mdx +0 -0
  189. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.zh-CN.mdx +0 -0
  190. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.mdx +0 -0
  191. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.zh-CN.mdx +0 -0
  192. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.mdx +0 -0
  193. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.mdx +0 -0
  194. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.mdx +0 -0
  195. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.zh-CN.mdx +0 -0
  196. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.mdx +0 -0
  197. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.zh-CN.mdx +0 -0
  198. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.mdx +0 -0
  199. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.zh-CN.mdx +0 -0
  200. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.mdx +0 -0
  201. /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.zh-CN.mdx +0 -0
@@ -0,0 +1,103 @@
1
+ ---
2
+ title: 配置 LobeHub 邮箱密码登录
3
+ description: 了解如何配置 LobeHub 的邮箱密码登录,包括启用/禁用选项和仅 SSO 模式。
4
+ tags:
5
+ - 邮箱
6
+ - 密码
7
+ - 身份验证
8
+ - LobeHub
9
+ ---
10
+
11
+ # 配置邮箱密码登录
12
+
13
+ LobeHub 默认支持传统的邮箱密码登录方式。本指南介绍可用的配置选项。
14
+
15
+ ## 默认行为
16
+
17
+ 默认情况下,邮箱密码登录已启用。用户可以使用邮箱地址注册并设置密码。
18
+
19
+ ## 配置选项
20
+
21
+ ### 禁用邮箱密码登录(仅 SSO 模式)
22
+
23
+ 如果你希望强制用户只能通过 SSO 提供商登录,请设置以下环境变量:
24
+
25
+ | 环境变量 | 类型 | 描述 |
26
+ | ----------------------------- | -- | ---------------- |
27
+ | `AUTH_DISABLE_EMAIL_PASSWORD` | 可选 | 设置为 `1` 禁用邮箱密码登录 |
28
+
29
+ 启用后:
30
+
31
+ - 登录页面隐藏邮箱输入框
32
+ - 仅显示 SSO 提供商登录按钮
33
+ - 注册页面重定向到登录页面
34
+ - 用户必须通过配置的 SSO 提供商进行身份验证
35
+
36
+ <Callout type={'warning'}>
37
+ 启用仅 SSO 模式前,请确保已通过 `AUTH_SSO_PROVIDERS` 配置了至少一个 SSO
38
+ 提供商。否则用户将无法登录。
39
+ </Callout>
40
+
41
+ ### 启用邮箱验证
42
+
43
+ 要求用户在登录前验证邮箱地址:
44
+
45
+ | 环境变量 | 类型 | 描述 |
46
+ | ------------------------- | -- | -------------- |
47
+ | `AUTH_EMAIL_VERIFICATION` | 可选 | 设置为 `1` 启用邮箱验证 |
48
+
49
+ 这需要配置邮件服务(SMTP)。详情请参阅[邮件服务配置](/zh/docs/self-hosting/auth/email)。
50
+
51
+ ### 启用魔法链接登录
52
+
53
+ 允许通过邮件魔法链接实现无密码登录:
54
+
55
+ | 环境变量 | 类型 | 描述 |
56
+ | ------------------------ | -- | ---------------- |
57
+ | `AUTH_ENABLE_MAGIC_LINK` | 可选 | 设置为 `1` 启用魔法链接登录 |
58
+
59
+ 这也需要配置邮件服务(SMTP)。
60
+
61
+ ## 修改密码
62
+
63
+ 用户可以通过以下两种方式修改密码:
64
+
65
+ 1. **个人设置**:前往 设置 > 个人资料 修改密码
66
+ 2. **忘记密码**:在登录页面输入邮箱后,进入密码输入步骤,点击密码框下方的「忘记密码」
67
+
68
+ <Callout type={'info'}>
69
+ 以上两种方式都需要配置邮件服务(SMTP)以发送密码重置邮件。
70
+ </Callout>
71
+
72
+ ## 配置示例
73
+
74
+ ### 仅 SSO(禁用邮箱密码)
75
+
76
+ ```bash
77
+ AUTH_DISABLE_EMAIL_PASSWORD=1
78
+ AUTH_SSO_PROVIDERS=google,github
79
+ ```
80
+
81
+ ### 邮箱密码 + 邮箱验证
82
+
83
+ ```bash
84
+ AUTH_EMAIL_VERIFICATION=1
85
+ SMTP_HOST=smtp.example.com
86
+ SMTP_PORT=587
87
+ SMTP_USER=noreply@example.com
88
+ SMTP_PASS=your-password
89
+ ```
90
+
91
+ ### 邮箱密码 + 魔法链接
92
+
93
+ ```bash
94
+ AUTH_ENABLE_MAGIC_LINK=1
95
+ SMTP_HOST=smtp.example.com
96
+ SMTP_PORT=587
97
+ SMTP_USER=noreply@example.com
98
+ SMTP_PASS=your-password
99
+ ```
100
+
101
+ <Callout type={'tip'}>
102
+ 前往[环境变量](/zh/docs/self-hosting/environment-variables/auth)查看所有身份验证相关变量的详细信息。
103
+ </Callout>
@@ -1,12 +1,12 @@
1
1
  ---
2
- title: Configuring WeChat Authentication for LobeChat
2
+ title: Configuring WeChat Authentication for LobeHub
3
3
  description: >-
4
- Learn how to configure WeChat SSO for LobeChat, including creating an
4
+ Learn how to configure WeChat SSO for LobeHub, including creating an
5
5
  application on WeChat Open Platform.
6
6
  tags:
7
7
  - WeChat
8
8
  - Authentication
9
- - LobeChat
9
+ - LobeHub
10
10
  - Single Sign-On
11
11
  ---
12
12
 
@@ -47,12 +47,12 @@ tags:
47
47
 
48
48
  ### Configure Environment Variables
49
49
 
50
- | Environment Variable | Type | Description |
51
- | -------------------------------- | -------- | --------------------------------------------------------------- |
52
- | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
53
- | `AUTH_SSO_PROVIDERS` | Required | Set to `wechat` |
54
- | `AUTH_WECHAT_ID` | Required | AppID from WeChat Open Platform |
55
- | `AUTH_WECHAT_SECRET` | Required | AppSecret from WeChat Open Platform |
50
+ | Environment Variable | Type | Description |
51
+ | -------------------- | -------- | --------------------------------------------------------------- |
52
+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
53
+ | `AUTH_SSO_PROVIDERS` | Required | Set to `wechat` |
54
+ | `AUTH_WECHAT_ID` | Required | AppID from WeChat Open Platform |
55
+ | `AUTH_WECHAT_SECRET` | Required | AppSecret from WeChat Open Platform |
56
56
 
57
57
  <Callout type={'tip'}>
58
58
  Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#wechat)
@@ -62,7 +62,7 @@ tags:
62
62
 
63
63
  <Callout type={'info'}>
64
64
  After successful deployment, users will be able to authenticate with WeChat
65
- and use LobeChat.
65
+ and use LobeHub.
66
66
  </Callout>
67
67
 
68
68
  ## Notes
@@ -1,10 +1,10 @@
1
1
  ---
2
- title: 在 LobeChat 中配置微信身份验证
3
- description: 学习如何在 LobeChat 中配置微信 SSO,包括在微信开放平台创建应用。
2
+ title: 在 LobeHub 中配置微信身份验证
3
+ description: 学习如何在 LobeHub 中配置微信 SSO,包括在微信开放平台创建应用。
4
4
  tags:
5
5
  - 微信
6
6
  - 身份验证
7
- - LobeChat
7
+ - LobeHub
8
8
  - 单点登录
9
9
  ---
10
10
 
@@ -43,12 +43,12 @@ tags:
43
43
 
44
44
  ### 配置环境变量
45
45
 
46
- | 环境变量 | 类型 | 描述 |
47
- | -------------------------------- | -- | -------------------------------------- |
48
- | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
49
- | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `wechat` |
50
- | `AUTH_WECHAT_ID` | 必选 | 微信开放平台的 AppID |
51
- | `AUTH_WECHAT_SECRET` | 必选 | 微信开放平台的 AppSecret |
46
+ | 环境变量 | 类型 | 描述 |
47
+ | -------------------- | -- | -------------------------------------- |
48
+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
49
+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `wechat` |
50
+ | `AUTH_WECHAT_ID` | 必选 | 微信开放平台的 AppID |
51
+ | `AUTH_WECHAT_SECRET` | 必选 | 微信开放平台的 AppSecret |
52
52
 
53
53
  <Callout type={'tip'}>
54
54
  前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#wechat)
@@ -57,7 +57,7 @@ tags:
57
57
  </Steps>
58
58
 
59
59
  <Callout type={'info'}>
60
- 部署成功后,用户将可以通过微信身份认证并使用 LobeChat
60
+ 部署成功后,用户将可以通过微信身份认证并使用 LobeHub
61
61
  </Callout>
62
62
 
63
63
  ## 注意事项
@@ -1,12 +1,12 @@
1
1
  ---
2
- title: Configuring ZITADEL Authentication for LobeChat
2
+ title: Configuring ZITADEL Authentication for LobeHub
3
3
  description: >-
4
- Learn how to configure ZITADEL SSO for LobeChat, including creating an
4
+ Learn how to configure ZITADEL SSO for LobeHub, including creating an
5
5
  application and setting up environment variables.
6
6
  tags:
7
7
  - ZITADEL
8
8
  - Authentication
9
- - LobeChat
9
+ - LobeHub
10
10
  - Single Sign-On
11
11
  - OIDC
12
12
  ---
@@ -23,7 +23,7 @@ tags:
23
23
  3. Click **New** to create a new application
24
24
  4. Select **Web** as the application type
25
25
  5. Configure:
26
- - Name: `LobeChat`
26
+ - Name: `LobeHub`
27
27
  - Authentication Method: `CODE` (for confidential clients)
28
28
  6. Add redirect URI:
29
29
 
@@ -42,15 +42,15 @@ tags:
42
42
 
43
43
  ### Configure Environment Variables
44
44
 
45
- When deploying LobeChat, you need to configure the following environment variables:
45
+ When deploying LobeHub, you need to configure the following environment variables:
46
46
 
47
- | Environment Variable | Type | Description |
48
- | -------------------------------- | -------- | ----------------------------------------------------------------------------- |
49
- | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
50
- | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `zitadel` for ZITADEL |
51
- | `AUTH_ZITADEL_ID` | Required | Client ID from ZITADEL application |
52
- | `AUTH_ZITADEL_SECRET` | Required | Client Secret from ZITADEL application |
53
- | `AUTH_ZITADEL_ISSUER` | Required | ZITADEL issuer URL (e.g., `https://your-instance.zitadel.cloud`) |
47
+ | Environment Variable | Type | Description |
48
+ | --------------------- | -------- | ----------------------------------------------------------------------------- |
49
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
50
+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeHub. Use `zitadel` for ZITADEL |
51
+ | `AUTH_ZITADEL_ID` | Required | Client ID from ZITADEL application |
52
+ | `AUTH_ZITADEL_SECRET` | Required | Client Secret from ZITADEL application |
53
+ | `AUTH_ZITADEL_ISSUER` | Required | ZITADEL issuer URL (e.g., `https://your-instance.zitadel.cloud`) |
54
54
 
55
55
  <Callout type={'info'}>
56
56
  **Alternative Environment Variables**: For backward compatibility, the following aliases are also supported:
@@ -64,7 +64,7 @@ tags:
64
64
  </Steps>
65
65
 
66
66
  <Callout type={'info'}>
67
- After successful deployment, users will be able to authenticate with ZITADEL and use LobeChat.
67
+ After successful deployment, users will be able to authenticate with ZITADEL and use LobeHub.
68
68
  </Callout>
69
69
 
70
70
  ## Related Resources
@@ -1,10 +1,10 @@
1
1
  ---
2
- title: 在 LobeChat 中配置 ZITADEL 身份验证
3
- description: 学习如何在 LobeChat 中配置 ZITADEL SSO,包括创建应用和设置环境变量。
2
+ title: 在 LobeHub 中配置 ZITADEL 身份验证
3
+ description: 学习如何在 LobeHub 中配置 ZITADEL SSO,包括创建应用和设置环境变量。
4
4
  tags:
5
5
  - ZITADEL
6
6
  - 身份验证
7
- - LobeChat
7
+ - LobeHub
8
8
  - 单点登录
9
9
  - OIDC
10
10
  ---
@@ -21,7 +21,7 @@ tags:
21
21
  3. 点击 **New** 创建新应用
22
22
  4. 选择 **Web** 作为应用类型
23
23
  5. 配置:
24
- - Name: `LobeChat`
24
+ - Name: `LobeHub`
25
25
  - Authentication Method: `CODE`(用于机密客户端)
26
26
  6. 添加重定向 URI:
27
27
 
@@ -40,15 +40,15 @@ tags:
40
40
 
41
41
  ### 配置环境变量
42
42
 
43
- 在部署 LobeChat 时,你需要配置以下环境变量:
43
+ 在部署 LobeHub 时,你需要配置以下环境变量:
44
44
 
45
- | 环境变量 | 类型 | 描述 |
46
- | -------------------------------- | -- | ------------------------------------------------------------ |
47
- | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
48
- | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 ZITADEL 请填写 `zitadel` |
49
- | `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID |
50
- | `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret |
51
- | `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL Issuer URL(例如 `https://your-instance.zitadel.cloud`) |
45
+ | 环境变量 | 类型 | 描述 |
46
+ | --------------------- | -- | ------------------------------------------------------------ |
47
+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
48
+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 ZITADEL 请填写 `zitadel` |
49
+ | `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID |
50
+ | `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret |
51
+ | `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL Issuer URL(例如 `https://your-instance.zitadel.cloud`) |
52
52
 
53
53
  <Callout type={'info'}>
54
54
  **兼容的环境变量**:为了向后兼容,以下别名也支持:
@@ -61,7 +61,7 @@ tags:
61
61
  </Callout>
62
62
  </Steps>
63
63
 
64
- <Callout type={'info'}>部署成功后,用户将可以通过 ZITADEL 身份认证并使用 LobeChat。</Callout>
64
+ <Callout type={'info'}>部署成功后,用户将可以通过 ZITADEL 身份认证并使用 LobeHub。</Callout>
65
65
 
66
66
  ## 相关资源
67
67
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: LobeHub Authentication Service Configuration
3
3
  description: >-
4
- Learn how to configure external authentication services using Better Auth,
5
- Clerk, or Next Auth for centralized user authorization management. Supported
4
+ Learn how to configure external authentication services using Better Auth
5
+ for centralized user authorization management. Supported
6
6
  authentication services include Auth0, Azure ID, etc.
7
7
  tags:
8
8
  - Authentication Service
@@ -12,17 +12,7 @@ tags:
12
12
 
13
13
  # Authentication Service
14
14
 
15
- LobeHub supports the configuration of external authentication services using Better Auth, Clerk, or Next Auth for internal use within enterprises/organizations to centrally manage user authorization.
16
-
17
- <Callout type={'info'}>
18
- Looking for legacy authentication methods? See [Legacy Authentication](/docs/self-hosting/advanced/auth/legacy) for NextAuth and Clerk documentation.
19
- </Callout>
20
-
21
- Clerk is a comprehensive identity verification solution that has recently gained popularity. It provides a simple yet powerful API and services to handle user authentication and session management. Clerk's design philosophy is to offer a concise and modern authentication solution that enables developers to easily integrate and use it.
22
-
23
- LobeHub has deeply integrated with Clerk to provide users with a more secure and convenient login and registration experience. It also relieves developers from the burden of managing authentication logic. Clerk's concise and modern design philosophy aligns perfectly with LobeHub's goals, making user management on the entire platform more efficient and reliable.
24
-
25
- By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` in LobeHub's environment, you can enable and use Clerk.
15
+ LobeHub supports the configuration of external authentication services using Better Auth for internal use within enterprises/organizations to centrally manage user authorization.
26
16
 
27
17
  ## Better Auth
28
18
 
@@ -40,12 +30,11 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL
40
30
 
41
31
  To enable Better Auth in LobeHub, set the following environment variables:
42
32
 
43
- | Environment Variable | Type | Description |
44
- | -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45
- | `NEXT_PUBLIC_ENABLE_BETTER_AUTH` | Required | Set to `1` to enable Better Auth service |
46
- | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
47
- | `NEXT_PUBLIC_AUTH_URL` | Required | The browser-accessible base URL for Better Auth (e.g., `http://localhost:3010`, `https://LobeHub.com`). Optional for Vercel deployments (auto-detected from `VERCEL_URL`) |
48
- | `AUTH_SSO_PROVIDERS` | Optional | Comma-separated list of enabled SSO providers, e.g., `google,github,microsoft` |
33
+ | Environment Variable | Type | Description |
34
+ | ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
36
+ | `NEXT_PUBLIC_AUTH_URL` | Required | The browser-accessible base URL for Better Auth (e.g., `http://localhost:3010`, `https://LobeHub.com`). Optional for Vercel deployments (auto-detected from `VERCEL_URL`) |
37
+ | `AUTH_SSO_PROVIDERS` | Optional | Comma-separated list of enabled SSO providers, e.g., `google,github,microsoft` |
49
38
 
50
39
  ## Supported SSO Providers
51
40
 
@@ -72,6 +61,8 @@ To enable Better Auth in LobeHub, set the following environment variables:
72
61
  Click on a provider below for detailed configuration guides:
73
62
 
74
63
  <Cards>
64
+ <Card href={'/docs/self-hosting/advanced/auth/providers/password'} title={'Email/Password'} />
65
+
75
66
  <Card href={'/docs/self-hosting/advanced/auth/providers/github'} title={'GitHub'} />
76
67
 
77
68
  <Card href={'/docs/self-hosting/advanced/auth/providers/google'} title={'Google'} />
@@ -116,63 +107,7 @@ When configuring OAuth providers, use the following callback URL format:
116
107
 
117
108
  ## Email Service Configuration
118
109
 
119
- Used by email verification, password reset, and magic-link delivery. Two providers are supported:
120
-
121
- ### Option 1: Nodemailer (SMTP)
122
-
123
- Send emails via SMTP protocol, suitable for users with existing email services. See [Nodemailer SMTP docs](https://nodemailer.com/smtp/).
124
-
125
- | Environment Variable | Type | Description | Example |
126
- | ------------------------ | -------- | -------------------------------------------------------------- | --------------------- |
127
- | `EMAIL_SERVICE_PROVIDER` | Optional | Set to `nodemailer` (default) | `nodemailer` |
128
- | `SMTP_HOST` | Required | SMTP server hostname | `smtp.gmail.com` |
129
- | `SMTP_PORT` | Required | SMTP server port (`587` for TLS, `465` for SSL) | `587` |
130
- | `SMTP_SECURE` | Optional | `true` for SSL (port 465), `false` for TLS (port 587) | `false` |
131
- | `SMTP_USER` | Required | SMTP auth username | `user@gmail.com` |
132
- | `SMTP_PASS` | Required | SMTP auth password | `your-app-password` |
133
- | `SMTP_FROM` | Optional | Sender address (required for AWS SES), defaults to `SMTP_USER` | `noreply@example.com` |
134
-
135
- <Callout type={'warning'}>
136
- When using Gmail, you must use an App Password instead of your account password. Generate one at [Google App Passwords](https://myaccount.google.com/apppasswords).
137
- </Callout>
138
-
139
- ### Option 2: Resend
140
-
141
- [Resend](https://resend.com/) is a modern email API service with simple setup, recommended for new users.
142
-
143
- | Environment Variable | Type | Description | Example |
144
- | ------------------------ | ----------- | ----------------------------------------- | --------------------------- |
145
- | `EMAIL_SERVICE_PROVIDER` | Required | Set to `resend` | `resend` |
146
- | `RESEND_API_KEY` | Required | Resend API Key | `re_xxxxxxxxxxxxxxxxxxxxxx` |
147
- | `RESEND_FROM` | Recommended | Sender address, must be a verified domain | `noreply@your-domain.com` |
148
-
149
- <Callout type={'info'}>
150
- Before using Resend, you need to [verify your sending domain](https://resend.com/docs/dashboard/domains/introduction), otherwise emails can only be sent to your own address.
151
- </Callout>
152
-
153
- ### Common Configuration
154
-
155
- Before using Better Auth, please set the following variables in LobeHub's environment variables:
156
-
157
- ## Email Verification
158
-
159
- Enable email verification to ensure users own the email addresses they register with (off by default):
160
-
161
- | Environment Variable | Type | Description |
162
- | ------------------------- | -------- | ----------------------------------------------------------- |
163
- | `AUTH_EMAIL_VERIFICATION` | Optional | Set to `1` to require email verification after registration |
164
-
165
- <Callout type={'info'}>
166
- Email verification requires a working email service (SMTP or Resend) configured above. When enabled, users must verify their email address before they can sign in.
167
- </Callout>
168
-
169
- ## Magic Link (Passwordless) Login
170
-
171
- Enable magic-link login (depends on a working email provider above, off by default):
172
-
173
- | Environment Variable | Type | Description |
174
- | ------------------------ | -------- | ------------------------------------------------------------------- |
175
- | `AUTH_ENABLE_MAGIC_LINK` | Optional | Set to `1` to enable passwordless magic-link login (off by default) |
110
+ Email service is used for email verification, password reset, and magic link delivery. For detailed configuration, see [Email Service Configuration](/docs/self-hosting/auth/email).
176
111
 
177
112
  <Callout type={'tip'}>
178
113
  Go to [Environment Variables](/docs/self-hosting/environment-variables/auth#better-auth) for detailed information on all Better Auth variables.
@@ -216,6 +151,16 @@ The current authentication system requires email. Please configure a valid email
216
151
 
217
152
  This applies to all authentication methods, including SSO providers like Casdoor. Always ensure users have valid email addresses configured.
218
153
 
154
+ ### How do I enable SSO-only mode (disable email/password login)?
155
+
156
+ Set `AUTH_DISABLE_EMAIL_PASSWORD=1` to disable email/password authentication. When enabled:
157
+
158
+ - The email input will be hidden on the login page, only SSO buttons are displayed
159
+ - The signup page will redirect to the login page
160
+ - Users can only log in via configured SSO providers
161
+
162
+ Make sure you have at least one SSO provider configured via `AUTH_SSO_PROVIDERS` before enabling this option.
163
+
219
164
  ### How do I restrict registration to specific emails or domains?
220
165
 
221
166
  Set the `AUTH_ALLOWED_EMAILS` environment variable with a comma-separated list of allowed emails or domains. For example:
@@ -233,10 +178,8 @@ Set the `AUTH_ALLOWED_EMAILS` environment variable with a comma-separated list o
233
178
 
234
179
  Allow LobeHub to receive notifications when user information is updated in the identity provider. Supported providers include Casdoor and Logto. Please refer to the specific provider documentation for configuration details.
235
180
 
236
- ### Database Session
237
-
238
- Allow the session store in database, see also the [Auth.js Session Documentation](https://authjs.dev/concepts/session-strategies#database-session).
181
+ ### Other SSO Providers
239
182
 
240
- ## Other SSO Providers
183
+ If you need to use an SSO provider not included in the list above, you can use [Generic OIDC](/docs/self-hosting/auth/providers/generic-oidc) to configure any OpenID Connect or OAuth 2.0 compliant provider.
241
184
 
242
- Please refer to the [Auth.js](https://authjs.dev/getting-started/authentication/oauth) documentation and feel free to submit a Pull Request.
185
+ Feel free to submit a Pull Request to add more built-in SSO provider support. For details, see the [Better Auth documentation](https://www.better-auth.com/docs/concepts/oauth).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: LobeHub 身份验证服务配置
3
3
  description: >-
4
- 了解如何使用 Better Auth、Clerk 或 Next Auth 配置外部身份验证服务,以统一管理用户授权。支持的身份验证服务包括 Auth0、
4
+ 了解如何使用 Better Auth 配置外部身份验证服务,以统一管理用户授权。支持的身份验证服务包括 Auth0、
5
5
  Azure ID 等。
6
6
  tags:
7
7
  - 身份验证服务
@@ -12,17 +12,7 @@ tags:
12
12
 
13
13
  # 身份验证服务
14
14
 
15
- LobeHub 支持使用 Better Auth、Clerk 或者 Next Auth 配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
16
-
17
- <Callout type={'info'}>
18
- 需要使用旧版身份验证方案?请参阅 [旧版身份验证](/zh/docs/self-hosting/advanced/auth/legacy) 了解 NextAuth 和 Clerk 的文档。
19
- </Callout>
20
-
21
- Clerk 是一个近期流行起来的全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。Clerk 的设计哲学是提供一套简洁、现代的认证解决方案,使得开发者可以轻松集成和使用。
22
-
23
- LobeHub 与 Clerk 做了深度集成,能够为用户提供一个更加安全、便捷的登录和注册体验,同时也为开发者减轻了管理身份验证逻辑的负担。Clerk 的简洁和现代的设计理念与 LobeHub 的目标非常契合,使得整个平台的用户管理更加高效和可靠。
24
-
25
- 在 LobeHub 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。
15
+ LobeHub 支持使用 Better Auth 配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
26
16
 
27
17
  ## Better Auth
28
18
 
@@ -40,12 +30,11 @@ LobeHub 与 Clerk 做了深度集成,能够为用户提供一个更加安全
40
30
 
41
31
  要在 LobeHub 中启用 Better Auth,请设置以下环境变量:
42
32
 
43
- | 环境变量 | 类型 | 描述 |
44
- | -------------------------------- | -- | --------------------------------------------------------------------------------------------------------------- |
45
- | `NEXT_PUBLIC_ENABLE_BETTER_AUTH` | 必选 | 设置为 `1` 以启用 Better Auth 服务 |
46
- | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
47
- | `NEXT_PUBLIC_AUTH_URL` | 必选 | 浏览器可访问的 Better Auth 基础 URL(例如 `http://localhost:3010`、`https://LobeHub.com`)。Vercel 部署时可选(会自动从 `VERCEL_URL` 获取) |
48
- | `AUTH_SSO_PROVIDERS` | 可选 | 启用的 SSO 提供商列表,以逗号分隔,例如 `google,github,microsoft` |
33
+ | 环境变量 | 类型 | 描述 |
34
+ | ---------------------- | -- | --------------------------------------------------------------------------------------------------------------- |
35
+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
36
+ | `NEXT_PUBLIC_AUTH_URL` | 必选 | 浏览器可访问的 Better Auth 基础 URL(例如 `http://localhost:3010`、`https://LobeHub.com`)。Vercel 部署时可选(会自动从 `VERCEL_URL` 获取) |
37
+ | `AUTH_SSO_PROVIDERS` | 可选 | 启用的 SSO 提供商列表,以逗号分隔,例如 `google,github,microsoft` |
49
38
 
50
39
  ## 支持的 SSO 提供商
51
40
 
@@ -72,6 +61,8 @@ LobeHub 与 Clerk 做了深度集成,能够为用户提供一个更加安全
72
61
  点击下方提供商查看详细配置指南:
73
62
 
74
63
  <Cards>
64
+ <Card href={'/zh/docs/self-hosting/advanced/auth/providers/password'} title={'邮箱密码'} />
65
+
75
66
  <Card href={'/zh/docs/self-hosting/advanced/auth/providers/github'} title={'GitHub'} />
76
67
 
77
68
  <Card href={'/zh/docs/self-hosting/advanced/auth/providers/google'} title={'Google'} />
@@ -116,63 +107,7 @@ LobeHub 与 Clerk 做了深度集成,能够为用户提供一个更加安全
116
107
 
117
108
  ## 邮件服务配置
118
109
 
119
- 用于邮箱验证、密码重置和魔法链接发送。支持两种邮件服务:
120
-
121
- ### 方式一:Nodemailer(SMTP)
122
-
123
- 使用 SMTP 协议发送邮件,适合已有邮箱服务的用户。参考 [Nodemailer SMTP 文档](https://nodemailer.com/smtp/)。
124
-
125
- | 环境变量 | 类型 | 描述 | 示例 |
126
- | ------------------------ | -- | ---------------------------------------------- | --------------------- |
127
- | `EMAIL_SERVICE_PROVIDER` | 可选 | 设置为 `nodemailer`(默认值) | `nodemailer` |
128
- | `SMTP_HOST` | 必选 | SMTP 服务器主机名 | `smtp.gmail.com` |
129
- | `SMTP_PORT` | 必选 | SMTP 服务器端口(TLS 通常为 `587`,SSL 为 `465`) | `587` |
130
- | `SMTP_SECURE` | 可选 | SSL 设置为 `true`(端口 465),TLS 设置为 `false`(端口 587) | `false` |
131
- | `SMTP_USER` | 必选 | SMTP 认证用户名 | `user@gmail.com` |
132
- | `SMTP_PASS` | 必选 | SMTP 认证密码 | `your-app-password` |
133
- | `SMTP_FROM` | 可选 | 发件人地址(AWS SES 必填),默认为 `SMTP_USER` | `noreply@example.com` |
134
-
135
- <Callout type={'warning'}>
136
- 使用 Gmail 时,需使用应用专用密码而非账户密码。前往 [Google 应用专用密码](https://myaccount.google.com/apppasswords) 生成。
137
- </Callout>
138
-
139
- ### 方式二:Resend
140
-
141
- [Resend](https://resend.com/) 是一个现代邮件 API 服务,配置简单,推荐新用户使用。
142
-
143
- | 环境变量 | 类型 | 描述 | 示例 |
144
- | ------------------------ | -- | ------------------------- | --------------------------- |
145
- | `EMAIL_SERVICE_PROVIDER` | 必选 | 设置为 `resend` | `resend` |
146
- | `RESEND_API_KEY` | 必选 | Resend API Key | `re_xxxxxxxxxxxxxxxxxxxxxx` |
147
- | `RESEND_FROM` | 推荐 | 发件人地址,需为 Resend 已验证域名下的邮箱 | `noreply@your-domain.com` |
148
-
149
- <Callout type={'info'}>
150
- 使用 Resend 前需先 [验证发件域名](https://resend.com/docs/dashboard/domains/introduction),否则只能发送到自己的邮箱。
151
- </Callout>
152
-
153
- ### 通用配置
154
-
155
- 在使用 Better Auth 之前,请先在 LobeHub 的环境变量中设置以下变量:
156
-
157
- ## 邮箱验证
158
-
159
- 启用邮箱验证以确保用户拥有其注册的邮箱地址(默认关闭):
160
-
161
- | 环境变量 | 类型 | 描述 |
162
- | ------------------------- | -- | -------------------- |
163
- | `AUTH_EMAIL_VERIFICATION` | 可选 | 设置为 `1` 以要求注册后进行邮箱验证 |
164
-
165
- <Callout type={'info'}>
166
- 邮箱验证需要上方已配置好的邮件服务(SMTP 或 Resend)。启用后,用户必须验证其邮箱地址才能登录。
167
- </Callout>
168
-
169
- ## 魔法链接(免密)登录
170
-
171
- 启用魔法链接登录(依赖上方已配置好的邮件服务,默认关闭):
172
-
173
- | 环境变量 | 类型 | 描述 |
174
- | ------------------------ | -- | ----------------------- |
175
- | `AUTH_ENABLE_MAGIC_LINK` | 可选 | 设置为 `1` 以启用魔法链接登录(默认关闭) |
110
+ 邮件服务用于邮箱验证、密码重置和魔法链接发送。详细配置请参阅 [邮件服务配置](/zh/docs/self-hosting/auth/email)。
176
111
 
177
112
  <Callout type={'tip'}>
178
113
  前往 [环境变量](/zh/docs/self-hosting/environment-variables/auth#better-auth) 可查阅所有 Better Auth 相关变量详情。
@@ -217,6 +152,16 @@ Better Auth 支持内置提供商(Google、GitHub、Microsoft、Apple、AWS Co
217
152
 
218
153
  这适用于所有身份验证方式,包括 Casdoor 等 SSO 提供商。请确保用户配置了有效的邮箱地址。
219
154
 
155
+ ### 如何启用仅 SSO 模式(禁用邮箱密码登录)?
156
+
157
+ 设置 `AUTH_DISABLE_EMAIL_PASSWORD=1` 可禁用邮箱密码登录。启用后:
158
+
159
+ - 登录页面将隐藏邮箱输入框,仅显示 SSO 登录按钮
160
+ - 注册页面将重定向到登录页面
161
+ - 用户只能通过配置的 SSO 提供商登录
162
+
163
+ 启用此选项前,请确保已通过 `AUTH_SSO_PROVIDERS` 配置了至少一个 SSO 提供商。
164
+
220
165
  ### 如何限制只允许特定邮箱或域名注册?
221
166
 
222
167
  设置 `AUTH_ALLOWED_EMAILS` 环境变量,支持完整邮箱地址或域名,以逗号分隔。例如:
@@ -232,10 +177,8 @@ Better Auth 支持内置提供商(Google、GitHub、Microsoft、Apple、AWS Co
232
177
 
233
178
  允许 LobeHub 在身份提供商中用户信息更新时接收通知。支持的提供商包括 Casdoor 和 Logto。请参考具体提供商文档进行配置。
234
179
 
235
- ### 数据库会话
236
-
237
- 允许会话存储在数据库中,详情请参阅 [Auth.js 会话文档](https://authjs.dev/concepts/session-strategies#database-session)。
180
+ ### 其他 SSO 提供商
238
181
 
239
- ## 其他 SSO 提供商
182
+ 如果你需要使用上述列表中未包含的 SSO 提供商,可以使用 [Generic OIDC](/zh/docs/self-hosting/auth/providers/generic-oidc) 来配置任何符合 OpenID Connect 或 OAuth 2.0 标准的提供商。
240
183
 
241
- 请参考 [Auth.js](https://authjs.dev/getting-started/authentication/oauth) 文档,欢迎提交 Pull Request
184
+ 欢迎提交 Pull Request 来添加更多内置 SSO 提供商支持。详情请参考 [Better Auth 文档](https://www.better-auth.com/docs/concepts/oauth)。
@@ -46,6 +46,13 @@ LobeHub provides a complete authentication service capability when deployed. The
46
46
  - Default: `-`
47
47
  - Example: `example.com,admin@other.com`
48
48
 
49
+ #### `AUTH_DISABLE_EMAIL_PASSWORD`
50
+
51
+ - Type: Optional
52
+ - Description: Set to `1` to disable email/password authentication, forcing users to use SSO login only. When enabled, the email input will be hidden on the login page and the signup page will redirect to login.
53
+ - Default: `0`
54
+ - Example: `1`
55
+
49
56
  #### `JWKS_KEY`
50
57
 
51
58
  - Type: Required
@@ -44,6 +44,13 @@ LobeHub 在部署时提供了完善的身份验证服务能力,以下是相关
44
44
  - 默认值:`-`
45
45
  - 示例:`example.com,admin@other.com`
46
46
 
47
+ #### `AUTH_DISABLE_EMAIL_PASSWORD`
48
+
49
+ - 类型:可选
50
+ - 描述:设置为 `1` 以禁用邮箱密码登录,强制用户使用 SSO 登录。启用后,登录页面将隐藏邮箱输入框,注册页面将重定向到登录页。
51
+ - 默认值:`0`
52
+ - 示例:`1`
53
+
47
54
  #### `JWKS_KEY`
48
55
 
49
56
  - 类型:必选