@lobehub/chat 1.62.8 → 1.62.9

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 1.62.9](https://github.com/lobehub/lobe-chat/compare/v1.62.8...v1.62.9)
6
+
7
+ <sup>Released on **2025-02-22**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Next-auth user id not found in create agent index.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Next-auth user id not found in create agent index, closes [#6410](https://github.com/lobehub/lobe-chat/issues/6410) ([704c7c8](https://github.com/lobehub/lobe-chat/commit/704c7c8))
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 1.62.8](https://github.com/lobehub/lobe-chat/compare/v1.62.7...v1.62.8)
6
31
 
7
32
  <sup>Released on **2025-02-22**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Next-auth user id not found in create agent index."
6
+ ]
7
+ },
8
+ "date": "2025-02-22",
9
+ "version": "1.62.9"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.62.8",
3
+ "version": "1.62.9",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot 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",
@@ -68,23 +68,26 @@ export function LobeNextAuthDbAdapter(serverDB: NeonDatabase<typeof schema>): Ad
68
68
  }
69
69
 
70
70
  // create a new user if it does not exist
71
+ // Use id from provider if it exists, otherwise use id assigned by next-auth
72
+ // ref: https://github.com/lobehub/lobe-chat/pull/2935
73
+ const uid = providerAccountId ?? id;
71
74
  await UserModel.createUser(
72
75
  serverDB,
73
76
  mapAdapterUserToLobeUser({
74
77
  email,
75
78
  emailVerified,
76
79
  // Use providerAccountId as userid to identify if the user exists in a SSO provider
77
- id: providerAccountId ?? id,
80
+ id: uid,
78
81
  image,
79
82
  name,
80
83
  }),
81
84
  );
82
85
 
83
86
  // 3. Create an inbox session for the user
84
- const agentService = new AgentService(serverDB, id);
87
+ const agentService = new AgentService(serverDB, uid);
85
88
  await agentService.createInbox();
86
89
 
87
- return { ...user, id: providerAccountId ?? id };
90
+ return { ...user, id: uid };
88
91
  },
89
92
  async createVerificationToken(data): Promise<VerificationToken | null | undefined> {
90
93
  return serverDB