Merge remote-tracking branch 'origin/v2/main' into 1579-wave-1
# Conflicts: # AGENTS.md # clients/cli/README.md # clients/web/src/App.test.tsx # clients/web/src/App.tsx # clients/web/src/test/core/auth/utils.test.ts # core/mcp/node/transport.ts # test-servers/src/composable-test-server.ts
This commit is contained in:
commit
cfbdfdf2bd
1 changed files with 15921 additions and 1202 deletions
|
|
@ -102,6 +102,7 @@ export type OAuthProviderConfig = {
|
|||
export class BaseOAuthClientProvider implements OAuthClientProvider {
|
||||
private capturedAuthUrl: URL | null = null;
|
||||
private eventTarget: EventTarget | null = null;
|
||||
private suppressAuthorizationNavigation = false;
|
||||
|
||||
protected serverUrl: string;
|
||||
protected storage: OAuthStorage;
|
||||
|
|
@ -138,6 +139,11 @@ export class BaseOAuthClientProvider implements OAuthClientProvider {
|
|||
this.capturedAuthUrl = null;
|
||||
}
|
||||
|
||||
/** Capture authorize URL without navigating (step-up confirmation modal). */
|
||||
setSuppressAuthorizationNavigation(suppress: boolean): void {
|
||||
this.suppressAuthorizationNavigation = suppress;
|
||||
}
|
||||
|
||||
get scope(): string | undefined {
|
||||
return this.storage.getScope(this.serverUrl);
|
||||
}
|
||||
|
|
@ -217,17 +223,16 @@ export class BaseOAuthClientProvider implements OAuthClientProvider {
|
|||
// Capture URL for return value
|
||||
this.capturedAuthUrl = authorizationUrl;
|
||||
|
||||
// Dispatch event if event target is set
|
||||
if (this.eventTarget) {
|
||||
this.eventTarget.dispatchEvent(
|
||||
new CustomEvent("oauthAuthorizationRequired", {
|
||||
detail: { url: authorizationUrl },
|
||||
}),
|
||||
);
|
||||
if (!this.suppressAuthorizationNavigation) {
|
||||
if (this.eventTarget) {
|
||||
this.eventTarget.dispatchEvent(
|
||||
new CustomEvent("oauthAuthorizationRequired", {
|
||||
detail: { url: authorizationUrl },
|
||||
}),
|
||||
);
|
||||
}
|
||||
this.navigation.navigateToAuthorization(authorizationUrl);
|
||||
}
|
||||
|
||||
// Original navigation behavior
|
||||
this.navigation.navigateToAuthorization(authorizationUrl);
|
||||
}
|
||||
|
||||
async saveCodeVerifier(codeVerifier: string): Promise<void> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue