@lobehub/chat 1.122.5 → 1.122.7
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,48 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.122.7](https://github.com/lobehub/lobe-chat/compare/v1.122.6...v1.122.7)
|
6
|
+
|
7
|
+
<sup>Released on **2025-09-04**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Make LobeNextAuthDBAdapter Edge Compatible.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: Make LobeNextAuthDBAdapter Edge Compatible, closes [#9088](https://github.com/lobehub/lobe-chat/issues/9088) ([411f88e](https://github.com/lobehub/lobe-chat/commit/411f88e))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.122.6](https://github.com/lobehub/lobe-chat/compare/v1.122.5...v1.122.6)
|
31
|
+
|
32
|
+
<sup>Released on **2025-09-04**</sup>
|
33
|
+
|
34
|
+
<br/>
|
35
|
+
|
36
|
+
<details>
|
37
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
38
|
+
|
39
|
+
</details>
|
40
|
+
|
41
|
+
<div align="right">
|
42
|
+
|
43
|
+
[](#readme-top)
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
5
47
|
### [Version 1.122.5](https://github.com/lobehub/lobe-chat/compare/v1.122.4...v1.122.5)
|
6
48
|
|
7
49
|
<sup>Released on **2025-09-04**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Make LobeNextAuthDBAdapter Edge Compatible."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-09-04",
|
9
|
+
"version": "1.122.7"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {},
|
13
|
+
"date": "2025-09-04",
|
14
|
+
"version": "1.122.6"
|
15
|
+
},
|
2
16
|
{
|
3
17
|
"children": {
|
4
18
|
"improvements": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.122.
|
3
|
+
"version": "1.122.7",
|
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",
|
@@ -1,32 +1,36 @@
|
|
1
1
|
import type { NextAuthConfig } from 'next-auth';
|
2
2
|
|
3
|
-
import { ssoProviders } from './sso-providers';
|
4
|
-
import { LobeNextAuthDbAdapter } from './adapter';
|
5
3
|
import { getAuthConfig } from '@/config/auth';
|
4
|
+
import { getServerDBConfig } from '@/config/db';
|
5
|
+
|
6
|
+
import { LobeNextAuthDbAdapter } from './adapter';
|
7
|
+
import { ssoProviders } from './sso-providers';
|
6
8
|
|
7
9
|
const {
|
8
10
|
NEXT_AUTH_DEBUG,
|
9
11
|
NEXT_AUTH_SECRET,
|
10
12
|
NEXT_AUTH_SSO_SESSION_STRATEGY,
|
11
13
|
NEXT_AUTH_SSO_PROVIDERS,
|
12
|
-
NEXT_PUBLIC_ENABLE_NEXT_AUTH
|
14
|
+
NEXT_PUBLIC_ENABLE_NEXT_AUTH,
|
13
15
|
} = getAuthConfig();
|
14
16
|
|
17
|
+
const { NEXT_PUBLIC_ENABLED_SERVER_SERVICE } = getServerDBConfig();
|
18
|
+
|
15
19
|
export const initSSOProviders = () => {
|
16
20
|
return NEXT_PUBLIC_ENABLE_NEXT_AUTH
|
17
21
|
? NEXT_AUTH_SSO_PROVIDERS.split(/[,,]/).map((provider) => {
|
18
|
-
|
22
|
+
const validProvider = ssoProviders.find((item) => item.id === provider.trim());
|
19
23
|
|
20
|
-
|
24
|
+
if (validProvider) return validProvider.provider;
|
21
25
|
|
22
|
-
|
23
|
-
|
26
|
+
throw new Error(`[NextAuth] provider ${provider} is not supported`);
|
27
|
+
})
|
24
28
|
: [];
|
25
29
|
};
|
26
30
|
|
27
31
|
// Notice this is only an object, not a full Auth.js instance
|
28
32
|
export default {
|
29
|
-
adapter: LobeNextAuthDbAdapter(),
|
33
|
+
adapter: NEXT_PUBLIC_ENABLED_SERVER_SERVICE ? LobeNextAuthDbAdapter() : undefined,
|
30
34
|
callbacks: {
|
31
35
|
// Note: Data processing order of callback: authorize --> jwt --> session
|
32
36
|
async jwt({ token, user }) {
|
@@ -56,7 +60,8 @@ export default {
|
|
56
60
|
providers: initSSOProviders(),
|
57
61
|
secret: NEXT_AUTH_SECRET,
|
58
62
|
session: {
|
59
|
-
|
63
|
+
// Force use JWT if server service is disabled
|
64
|
+
strategy: NEXT_PUBLIC_ENABLED_SERVER_SERVICE ? NEXT_AUTH_SSO_SESSION_STRATEGY : 'jwt',
|
60
65
|
},
|
61
66
|
trustHost: process.env?.AUTH_TRUST_HOST ? process.env.AUTH_TRUST_HOST === 'true' : true,
|
62
67
|
} satisfies NextAuthConfig;
|
File without changes
|