fix(auth): await OAuth storage load() to fix remote OAuth races
This commit is contained in:
parent
7bd26c938e
commit
a24091484c
1 changed files with 245 additions and 133 deletions
|
|
@ -2191,6 +2191,7 @@ function App() {
|
|||
}
|
||||
|
||||
void (async () => {
|
||||
await webOAuthStorage.load();
|
||||
const client = setupClientForServer(server, sessionId);
|
||||
setActiveServerId(server.id);
|
||||
try {
|
||||
|
|
@ -2246,7 +2247,7 @@ function App() {
|
|||
});
|
||||
}
|
||||
})();
|
||||
}, [servers, setupClientForServer, showReAuthBanner]);
|
||||
}, [servers, setupClientForServer, showReAuthBanner, webOAuthStorage]);
|
||||
|
||||
const onToggleConnection = useCallback(
|
||||
async (id: string) => {
|
||||
|
|
@ -3273,7 +3274,7 @@ function App() {
|
|||
const clearServerOAuthAndDisconnect = useCallback(
|
||||
async (server: { id: string; name: string; config: MCPServerConfig }) => {
|
||||
const isActive = server.id === activeServerId;
|
||||
const cleared = clearServerOAuthState({
|
||||
const cleared = await clearServerOAuthState({
|
||||
config: server.config,
|
||||
inspectorClient: isActive ? inspectorClient : null,
|
||||
isActiveConnection: isActive,
|
||||
|
|
|
|||
Loading…
Reference in a new issue