Spaces:
Running
Running
fix: validate OAuth configuration before starting the flow
Browse files
src/components/MCPServerManager.tsx
CHANGED
@@ -312,12 +312,17 @@ export const MCPServerManager: React.FC<MCPServerManagerProps> = ({
|
|
312 |
const endpoints = await discoverOAuthEndpoints(
|
313 |
newServer.url
|
314 |
);
|
|
|
|
|
|
|
|
|
|
|
315 |
startOAuthFlow({
|
316 |
authorizationEndpoint:
|
317 |
endpoints.authorizationEndpoint,
|
318 |
-
clientId: endpoints.clientId,
|
319 |
-
redirectUri: endpoints.redirectUri,
|
320 |
-
scopes: endpoints.scopes,
|
321 |
});
|
322 |
} catch (err) {
|
323 |
setNotification({
|
|
|
312 |
const endpoints = await discoverOAuthEndpoints(
|
313 |
newServer.url
|
314 |
);
|
315 |
+
|
316 |
+
if (!endpoints.clientId || !endpoints.redirectUri) {
|
317 |
+
throw new Error("Missing required OAuth configuration (clientId or redirectUri)");
|
318 |
+
}
|
319 |
+
|
320 |
startOAuthFlow({
|
321 |
authorizationEndpoint:
|
322 |
endpoints.authorizationEndpoint,
|
323 |
+
clientId: endpoints.clientId as string,
|
324 |
+
redirectUri: endpoints.redirectUri as string,
|
325 |
+
scopes: (endpoints.scopes || []) as string[],
|
326 |
});
|
327 |
} catch (err) {
|
328 |
setNotification({
|