Revert "Fix: OAuth CORS errors when Connection Type is 'Via Proxy'"
This commit is contained in:
parent
efbae5f927
commit
2539711bc0
1 changed files with 44 additions and 1098 deletions
|
|
@ -64,7 +64,6 @@ import {
|
|||
clearScopeFromSessionStorage,
|
||||
discoverScopes,
|
||||
} from "../auth";
|
||||
import { discoverOAuthProtectedResourceMetadataViaProxy } from "../oauth-proxy";
|
||||
import {
|
||||
getMCPProxyAddress,
|
||||
getMCPTaskTtl,
|
||||
|
|
@ -405,26 +404,13 @@ export function useConnection({
|
|||
// Only discover resource metadata when we need to discover scopes
|
||||
let resourceMetadata;
|
||||
try {
|
||||
if (connectionType === "proxy") {
|
||||
resourceMetadata =
|
||||
await discoverOAuthProtectedResourceMetadataViaProxy(
|
||||
sseUrl,
|
||||
config,
|
||||
);
|
||||
} else {
|
||||
resourceMetadata = await discoverOAuthProtectedResourceMetadata(
|
||||
new URL("/", sseUrl),
|
||||
);
|
||||
}
|
||||
resourceMetadata = await discoverOAuthProtectedResourceMetadata(
|
||||
new URL("/", sseUrl),
|
||||
);
|
||||
} catch {
|
||||
// Resource metadata is optional, continue without it
|
||||
}
|
||||
scope = await discoverScopes(
|
||||
sseUrl,
|
||||
connectionType,
|
||||
config,
|
||||
resourceMetadata,
|
||||
);
|
||||
scope = await discoverScopes(sseUrl, resourceMetadata);
|
||||
}
|
||||
|
||||
saveScopeToSessionStorage(sseUrl, scope);
|
||||
|
|
|
|||
Loading…
Reference in a new issue