@lobehub/lobehub 2.0.0-next.167 → 2.0.0-next.168

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.168](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.167...v2.0.0-next.168)
6
+
7
+ <sup>Released on **2025-12-12**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Slove market oidc error.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Slove market oidc error, closes [#10715](https://github.com/lobehub/lobe-chat/issues/10715) ([108d2a7](https://github.com/lobehub/lobe-chat/commit/108d2a7))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ## [Version 2.0.0-next.167](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.166...v2.0.0-next.167)
6
31
 
7
32
  <sup>Released on **2025-12-11**</sup>
package/README.md CHANGED
@@ -387,8 +387,8 @@ Our marketplace is not just a showcase platform but also a collaborative space.
387
387
  | Recent Submits | Description |
388
388
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
389
389
  | [Turtle Soup Host](https://lobechat.com/discover/assistant/lateral-thinking-puzzle)<br/><sup>By **[CSY2022](https://github.com/CSY2022)** on **2025-06-19**</sup> | A turtle soup host needs to provide the scenario, the complete story (truth of the event), and the key point (the condition for guessing correctly).<br/>`turtle-soup` `reasoning` `interaction` `puzzle` `role-playing` |
390
- | [Gourmet Reviewer🍟](https://lobechat.com/discover/assistant/food-reviewer)<br/><sup>By **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**</sup> | Food critique expert<br/>`gourmet` `review` `writing` |
391
390
  | [Academic Writing Assistant](https://lobechat.com/discover/assistant/academic-writing-assistant)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2025-06-17**</sup> | Expert in academic research paper writing and formal documentation<br/>`academic-writing` `research` `formal-style` |
391
+ | [Gourmet Reviewer🍟](https://lobechat.com/discover/assistant/food-reviewer)<br/><sup>By **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**</sup> | Food critique expert<br/>`gourmet` `review` `writing` |
392
392
  | [Minecraft Senior Developer](https://lobechat.com/discover/assistant/java-development)<br/><sup>By **[iamyuuk](https://github.com/iamyuuk)** on **2025-06-17**</sup> | Expert in advanced Java development and Minecraft mod and server plugin development<br/>`development` `programming` `minecraft` `java` |
393
393
 
394
394
  > 📊 Total agents: [<kbd>**505**</kbd> ](https://lobechat.com/discover/assistants)
package/README.zh-CN.md CHANGED
@@ -376,8 +376,8 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
376
376
  | 最近新增 | 描述 |
377
377
  | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
378
378
  | [海龟汤主持人](https://lobechat.com/discover/assistant/lateral-thinking-puzzle)<br/><sup>By **[CSY2022](https://github.com/CSY2022)** on **2025-06-19**</sup> | 一个海龟汤主持人,需要自己提供汤面,汤底与关键点(猜中的判定条件)。<br/>`海龟汤` `推理` `互动` `谜题` `角色扮演` |
379
- | [美食评论员🍟](https://lobechat.com/discover/assistant/food-reviewer)<br/><sup>By **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**</sup> | 美食评价专家<br/>`美食` `评价` `写作` |
380
379
  | [学术写作助手](https://lobechat.com/discover/assistant/academic-writing-assistant)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2025-06-17**</sup> | 专业的学术研究论文写作和正式文档编写专家<br/>`学术写作` `研究` `正式风格` |
380
+ | [美食评论员🍟](https://lobechat.com/discover/assistant/food-reviewer)<br/><sup>By **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**</sup> | 美食评价专家<br/>`美食` `评价` `写作` |
381
381
  | [Minecraft 资深开发者](https://lobechat.com/discover/assistant/java-development)<br/><sup>By **[iamyuuk](https://github.com/iamyuuk)** on **2025-06-17**</sup> | 擅长高级 Java 开发及 Minecraft 开发<br/>`开发` `编程` `minecraft` `java` |
382
382
 
383
383
  > 📊 Total agents: [<kbd>**505**</kbd> ](https://lobechat.com/discover/assistants)
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Slove market oidc error."
6
+ ]
7
+ },
8
+ "date": "2025-12-12",
9
+ "version": "2.0.0-next.168"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "features": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.167",
3
+ "version": "2.0.0-next.168",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -1,11 +1,9 @@
1
- import type { EmailAddress } from '@clerk/backend';
2
1
  import { LobeChatDatabase } from '@lobechat/database';
3
2
  import debug from 'debug';
4
3
  import Provider, { Configuration, KoaContextWithOIDC, errors } from 'oidc-provider';
5
4
  import urlJoin from 'url-join';
6
5
 
7
6
  import { serverDBEnv } from '@/config/db';
8
- import { enableClerk } from '@/const/auth';
9
7
  import { UserModel } from '@/database/models/user';
10
8
  import { appEnv } from '@/envs/app';
11
9
  import { getJWKS } from '@/libs/oidc-provider/jwt';
@@ -15,59 +13,9 @@ import { DrizzleAdapter } from './adapter';
15
13
  import { defaultClaims, defaultClients, defaultScopes } from './config';
16
14
  import { createInteractionPolicy } from './interaction-policy';
17
15
 
18
- const logProvider = debug('lobe-oidc:provider'); // <--- 添加 provider 日志实例
16
+ const logProvider = debug('lobe-oidc:provider');
19
17
 
20
- const MARKET_CLIENT_ID = 'lobehub-market';
21
-
22
- const resolveClerkAccount = async (accountId: string) => {
23
- if (!enableClerk) return undefined;
24
-
25
- try {
26
- const { clerkClient } = await import('@clerk/nextjs/server');
27
- const client = await clerkClient();
28
- const user = await client.users.getUser(accountId);
29
-
30
- if (!user) {
31
- logProvider('Clerk user not found for accountId: %s', accountId);
32
- return undefined;
33
- }
34
-
35
- const pickName = () =>
36
- user.fullName ||
37
- [user.firstName, user.lastName].filter(Boolean).join(' ').trim() ||
38
- user.username ||
39
- user.id;
40
-
41
- const primaryEmail = user.primaryEmailAddressId
42
- ? user.emailAddresses.find((item: EmailAddress) => item.id === user.primaryEmailAddressId)
43
- : user.emailAddresses.at(0);
44
-
45
- return {
46
- accountId: user.id,
47
- async claims(_use: string, scope: string) {
48
- const scopeSet = new Set((scope || '').split(/\s+/).filter(Boolean));
49
- const claims: { [key: string]: any; sub: string } = { sub: user.id };
50
-
51
- if (scopeSet.has('profile')) {
52
- claims.name = pickName();
53
- if (user.imageUrl) claims.picture = user.imageUrl;
54
- }
55
-
56
- if (scopeSet.has('email') && primaryEmail) {
57
- claims.email = primaryEmail.emailAddress;
58
- claims.email_verified = primaryEmail.verification?.status === 'verified' || false;
59
- }
60
-
61
- return claims;
62
- },
63
- };
64
- } catch (error) {
65
- logProvider('Error resolving Clerk account for %s: %O', accountId, error);
66
- return undefined;
67
- }
68
- };
69
-
70
- export const API_AUDIENCE = 'urn:lobehub:chat'; // <-- 把这里换成你自己的 API 标识符
18
+ export const API_AUDIENCE = 'urn:lobehub:chat';
71
19
 
72
20
  /**
73
21
  * 获取 Cookie 密钥,使用 KEY_VAULTS_SECRET
@@ -190,25 +138,6 @@ export const createOIDCProvider = async (db: LobeChatDatabase): Promise<Provider
190
138
 
191
139
  logProvider('OIDC request client id: %s', clientId);
192
140
 
193
- if (clientId === MARKET_CLIENT_ID) {
194
- logProvider('Using Clerk account resolution for marketplace client');
195
-
196
- if (!accountIdToFind) {
197
- logProvider('No account id available for Clerk resolution, returning undefined');
198
- return undefined;
199
- }
200
-
201
- const clerkAccount = await resolveClerkAccount(accountIdToFind);
202
-
203
- if (clerkAccount) {
204
- logProvider('Clerk account resolved successfully for %s', accountIdToFind);
205
- return clerkAccount;
206
- }
207
-
208
- logProvider('Clerk account resolution failed for %s', accountIdToFind);
209
- return undefined;
210
- }
211
-
212
141
  logProvider(
213
142
  'Attempting to find account with ID: %s (source: %s)',
214
143
  accountIdToFind,