File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7878 return ;
7979 }
8080
81+ if (auth_type === ' oauth_2.1_static' && (! oauthClientId || ! oauthClientSecret )) {
82+ toast .error ($i18n .t (' Please enter Client ID and Client Secret' ));
83+ return ;
84+ }
85+
86+ // client_id is the tool server ID (used as the internal lookup key for both flows).
87+ // For static, client_secret signals the backend to use the static credential path.
88+ // The actual OAuth client_id/secret come from the connection info at save time.
8189 const formData: { url: string ; client_id: string ; client_secret? : string } = {
8290 url: url ,
83- client_id: id
91+ client_id: id ,
92+ ... (auth_type === ' oauth_2.1_static' ? { client_secret: oauthClientSecret } : {})
8493 };
8594
86- // For static OAuth, include client credentials
87- if (auth_type === ' oauth_2.1_static' ) {
88- if (! oauthClientId || ! oauthClientSecret ) {
89- toast .error ($i18n .t (' Please enter Client ID and Client Secret' ));
90- return ;
91- }
92- formData .client_id = id ;
93- formData .client_secret = oauthClientSecret ;
94- }
95-
9695 const res = await registerOAuthClient (localStorage .token , formData , ' mcp' ).catch ((err ) => {
9796 toast .error ($i18n .t (' Registration failed' ));
9897 return null ;
You can’t perform that action at this time.
0 commit comments