fix(mcp): replace relative oauth constent redirect by absolute redirect derived from APP_URL (#987)

This commit is contained in:
jubnl
2026-05-10 20:08:11 +02:00
parent 7f87dc1ce1
commit 2d582bb4fa
+2 -1
View File
@@ -147,7 +147,8 @@ export const trekOAuthProvider: OAuthServerProvider = {
if (params.state) qs.set('state', params.state);
if (params.resource) qs.set('resource', params.resource.href);
res.redirect(302, `/oauth/consent?${qs.toString()}`);
const base = getMcpSafeUrl().replace(/\/+$/, '');
res.redirect(302, `${base}/oauth/consent?${qs.toString()}`);
},
// Not called because skipLocalPkceValidation = true.