fix: Disconnecting should clear oauth state
This commit is contained in:
@@ -68,6 +68,12 @@ class InspectorOAuthClientProvider implements OAuthClientProvider {
|
||||
|
||||
return verifier;
|
||||
}
|
||||
|
||||
clear() {
|
||||
sessionStorage.removeItem(SESSION_KEYS.CLIENT_INFORMATION);
|
||||
sessionStorage.removeItem(SESSION_KEYS.TOKENS);
|
||||
sessionStorage.removeItem(SESSION_KEYS.CODE_VERIFIER);
|
||||
}
|
||||
}
|
||||
|
||||
export const authProvider = new InspectorOAuthClientProvider();
|
||||
|
||||
@@ -361,6 +361,7 @@ export function useConnection({
|
||||
|
||||
const disconnect = async () => {
|
||||
await mcpClient?.close();
|
||||
authProvider.clear();
|
||||
setMcpClient(null);
|
||||
setConnectionStatus("disconnected");
|
||||
setCompletionsSupported(false);
|
||||
|
||||
Reference in New Issue
Block a user