Skip to content

Commit 6a16e7c

Browse files
committed
fix: Disconnecting should clear oauth state
1 parent 4053aa1 commit 6a16e7c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

client/src/lib/auth.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ class InspectorOAuthClientProvider implements OAuthClientProvider {
6868

6969
return verifier;
7070
}
71+
72+
clear() {
73+
sessionStorage.removeItem(SESSION_KEYS.CLIENT_INFORMATION);
74+
sessionStorage.removeItem(SESSION_KEYS.TOKENS);
75+
sessionStorage.removeItem(SESSION_KEYS.CODE_VERIFIER);
76+
}
7177
}
7278

7379
export const authProvider = new InspectorOAuthClientProvider();

client/src/lib/hooks/useConnection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export function useConnection({
361361

362362
const disconnect = async () => {
363363
await mcpClient?.close();
364+
authProvider.clear();
364365
setMcpClient(null);
365366
setConnectionStatus("disconnected");
366367
setCompletionsSupported(false);

0 commit comments

Comments
 (0)