This commit is contained in:
Timothy Jaeryang Baek 2026-08-25 14:20:28 -04:00
parent 21366fa1b1
commit 5ce198b1d7
2 changed files with 1 additions and 26 deletions

View file

@ -572,15 +572,8 @@ export const initiateOAuthRedirect = (tool: {
}) => { }) => {
sessionStorage.setItem('pendingOAuthToolId', tool.id); sessionStorage.setItem('pendingOAuthToolId', tool.id);
sessionStorage.setItem('oauthRedirectInProgressToolId', tool.id); sessionStorage.setItem('oauthRedirectInProgressToolId', tool.id);
localStorage.setItem('pendingOAuthToolId', tool.id);
localStorage.setItem('oauthRedirectInProgressToolId', tool.id);
const authUrl = getOAuthClientAuthorizationUrl(tool.serverId, tool.authType ?? 'mcp'); const authUrl = getOAuthClientAuthorizationUrl(tool.serverId, tool.authType ?? 'mcp');
const tab = window.open(authUrl, '_blank'); window.open(authUrl, '_self', 'noopener');
if (!tab) {
localStorage.removeItem('pendingOAuthToolId');
localStorage.removeItem('oauthRedirectInProgressToolId');
window.open(authUrl, '_self', 'noopener');
}
}; };
export const getCodeExecutionConfig = async (token: string) => { export const getCodeExecutionConfig = async (token: string) => {

View file

@ -1069,24 +1069,6 @@
window.addEventListener('message', windowMessageEventHandler); window.addEventListener('message', windowMessageEventHandler);
const pendingOAuthToolId =
sessionStorage.getItem('pendingOAuthToolId') ?? localStorage.getItem('pendingOAuthToolId');
if (window.opener && window.location.pathname === '/' && pendingOAuthToolId) {
window.opener.postMessage(
{
type: 'oauth:complete',
toolId: pendingOAuthToolId,
error: new URLSearchParams(window.location.search).get('error')
},
window.location.origin
);
sessionStorage.removeItem('pendingOAuthToolId');
sessionStorage.removeItem('oauthRedirectInProgressToolId');
localStorage.removeItem('pendingOAuthToolId');
localStorage.removeItem('oauthRedirectInProgressToolId');
window.close();
}
let touchstartY = 0; let touchstartY = 0;
function isNavOrDescendant(el) { function isNavOrDescendant(el) {