fix(dashboard): clear local control-panel management key (#1372)

This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-05-23 21:44:53 -04:00
1 parent e6f764c79b
commit 6c0f7ac39c
2 files changed
+18

No files matched your search

@@ -94,6 +94,7 @@ describe('ControlPanelEmbed', () => {
const iframe = await screen.findByTitle('CLIProxy Management Panel');
expect(iframe).toHaveAttribute('src', '/api/cliproxy-local/management.html');
fireEvent.load(iframe);
await waitFor(() => {
expect(window.localStorage.removeItem).toHaveBeenCalledWith('cli-proxy-auth');
@@ -107,6 +108,7 @@ describe('ControlPanelEmbed', () => {
);
expect(window.localStorage.setItem).toHaveBeenCalledWith('managementKey', 'custom-secret');
expect(window.localStorage.setItem).toHaveBeenCalledWith('isLoggedIn', 'true');
expect(window.localStorage.removeItem).toHaveBeenCalledWith('managementKey');
});
vi.clearAllMocks();