Implement OAuth callback

This commit is contained in:
Justin Spahr-Summers
2025-01-24 13:08:39 +00:00
parent 16cb59670c
commit 23f89e49b8
4 changed files with 54 additions and 1 deletions

View File

@@ -166,6 +166,8 @@ export function useConnection({
} catch (error) {
console.error("Failed to connect to MCP server:", error);
if (error instanceof SseError && error.code === 401) {
// Store the server URL for the callback handler
sessionStorage.setItem('mcp_server_url', sseUrl);
const redirectUrl = await startOAuthFlow(sseUrl);
window.location.href = redirectUrl;
}