OAuth MCP: permitir volver a la app que conecta (Claude) en form-action

This commit is contained in:
2026-11-22 09:20:03 +00:00
parent 318af7b330
commit 44947367fd

View File

@@ -80,7 +80,7 @@ export function oauthRouter({ store, origin, authenticate, currentUser, redirect
const requestId=random(),browserSecret=random(); const requestId=random(),browserSecret=random();
await store.set('flow',hash(requestId),{...p,scopes,browserHash:hash(browserSecret)},600); await store.set('flow',hash(requestId),{...p,scopes,browserHash:hash(browserSecret)},600);
res.set({ res.set({
'Content-Security-Policy':"default-src 'none'; style-src 'unsafe-inline'; form-action 'self' http://127.0.0.1:*; frame-ancestors 'none'; base-uri 'none'", 'X-Frame-Options':'DENY','Referrer-Policy':'strict-origin','X-Content-Type-Options':'nosniff' 'Content-Security-Policy':`default-src 'none'; style-src 'unsafe-inline'; form-action 'self' ${new URL(p.redirect_uri).origin} http://127.0.0.1:*; frame-ancestors 'none'; base-uri 'none'`, 'X-Frame-Options':'DENY','Referrer-Policy':'strict-origin','X-Content-Type-Options':'nosniff'
}); });
res.cookie('integra_mcp_flow',browserSecret,{httpOnly:true,secure:true,sameSite:'lax',path:'/mcp-connect',maxAge:600000}); res.cookie('integra_mcp_flow',browserSecret,{httpOnly:true,secure:true,sameSite:'lax',path:'/mcp-connect',maxAge:600000});
res.type('html').send(`<!doctype html><html lang="es"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Conectar IntegraRepara</title> res.type('html').send(`<!doctype html><html lang="es"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Conectar IntegraRepara</title>