@lobehub/chat 0.159.5 → 0.159.6
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 0.159.6](https://github.com/lobehub/lobe-chat/compare/v0.159.5...v0.159.6)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-05-14**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Login button not show on user panel.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Login button not show on user panel, closes [#2496](https://github.com/lobehub/lobe-chat/issues/2496) ([39637fb](https://github.com/lobehub/lobe-chat/commit/39637fb))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.159.5](https://github.com/lobehub/lobe-chat/compare/v0.159.4...v0.159.5)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-05-14**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.159.
|
|
3
|
+
"version": "0.159.6",
|
|
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",
|
|
@@ -4,7 +4,6 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
4
4
|
|
|
5
5
|
import BrandWatermark from '@/components/BrandWatermark';
|
|
6
6
|
import Menu from '@/components/Menu';
|
|
7
|
-
import { enableAuth } from '@/const/auth';
|
|
8
7
|
import { useUserStore } from '@/store/user';
|
|
9
8
|
import { authSelectors } from '@/store/user/selectors';
|
|
10
9
|
|
|
@@ -18,10 +17,12 @@ import { useMenu } from './useMenu';
|
|
|
18
17
|
const PanelContent = memo<{ closePopover: () => void }>(({ closePopover }) => {
|
|
19
18
|
const router = useRouter();
|
|
20
19
|
const isLoginWithAuth = useUserStore(authSelectors.isLoginWithAuth);
|
|
21
|
-
const [openSignIn, signOut, openUserProfile] = useUserStore((s) => [
|
|
20
|
+
const [openSignIn, signOut, openUserProfile, enableAuth, enabledNextAuth] = useUserStore((s) => [
|
|
22
21
|
s.openLogin,
|
|
23
22
|
s.logout,
|
|
24
23
|
s.openUserProfile,
|
|
24
|
+
s.enableAuth(),
|
|
25
|
+
s.enabledNextAuth(),
|
|
25
26
|
]);
|
|
26
27
|
const { mainItems, logoutItems } = useMenu();
|
|
27
28
|
|
|
@@ -39,6 +40,8 @@ const PanelContent = memo<{ closePopover: () => void }>(({ closePopover }) => {
|
|
|
39
40
|
const handleSignOut = () => {
|
|
40
41
|
signOut();
|
|
41
42
|
closePopover();
|
|
43
|
+
// NextAuth doesn't need to redirect to login page
|
|
44
|
+
if (enabledNextAuth) return;
|
|
42
45
|
router.push('/login');
|
|
43
46
|
};
|
|
44
47
|
|
|
@@ -64,12 +64,9 @@ vi.mock('../DataStatistics', () => ({
|
|
|
64
64
|
// 定义一个变量来存储 enableAuth 的值
|
|
65
65
|
let enableAuth = true;
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return enableAuth;
|
|
71
|
-
},
|
|
72
|
-
}));
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
useUserStore.setState({ enableAuth: () => true });
|
|
69
|
+
});
|
|
73
70
|
|
|
74
71
|
afterEach(() => {
|
|
75
72
|
enableAuth = true;
|