This commit is contained in:
Timothy Jaeryang Baek
2026-04-13 17:54:08 -05:00
parent 715cf9797a
commit 2943955c52
+10 -11
View File
@@ -78,21 +78,20 @@
return;
}
if (auth_type === 'oauth_2.1_static' && (!oauthClientId || !oauthClientSecret)) {
toast.error($i18n.t('Please enter Client ID and Client Secret'));
return;
}
// client_id is the tool server ID (used as the internal lookup key for both flows).
// For static, client_secret signals the backend to use the static credential path.
// The actual OAuth client_id/secret come from the connection info at save time.
const formData: { url: string; client_id: string; client_secret?: string } = {
url: url,
client_id: id
client_id: id,
...(auth_type === 'oauth_2.1_static' ? { client_secret: oauthClientSecret } : {})
};
// For static OAuth, include client credentials
if (auth_type === 'oauth_2.1_static') {
if (!oauthClientId || !oauthClientSecret) {
toast.error($i18n.t('Please enter Client ID and Client Secret'));
return;
}
formData.client_id = id;
formData.client_secret = oauthClientSecret;
}
const res = await registerOAuthClient(localStorage.token, formData, 'mcp').catch((err) => {
toast.error($i18n.t('Registration failed'));
return null;