Skip to content

Commit 8821878

Browse files
authored
Merge branch 'main' into claude/issue-807-20250916-0337
2 parents 7b338b3 + 81889e6 commit 8821878

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

client/src/lib/auth.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
117117
return window.location.origin + "/oauth/callback";
118118
}
119119

120+
get debugRedirectUrl() {
121+
return window.location.origin + "/oauth/callback/debug";
122+
}
123+
120124
get clientMetadata(): OAuthClientMetadata {
125+
// Register both redirect URIs to support both normal and debug flows
121126
return {
122-
redirect_uris: [this.redirectUrl],
127+
redirect_uris: [this.redirectUrl, this.debugRedirectUrl],
123128
token_endpoint_auth_method: "none",
124129
grant_types: ["authorization_code", "refresh_token"],
125130
response_types: ["code"],
@@ -223,11 +228,13 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
223228
}
224229
}
225230

226-
// Overrides debug URL and allows saving server OAuth metadata to
231+
// Overrides redirect URL to use the debug endpoint and allows saving server OAuth metadata to
227232
// display in debug UI.
228233
export class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
229234
get redirectUrl(): string {
230-
return `${window.location.origin}/oauth/callback/debug`;
235+
// We can use the debug redirect URL here because it was already registered
236+
// in the parent class's clientMetadata along with the normal redirect URL
237+
return this.debugRedirectUrl;
231238
}
232239

233240
saveServerMetadata(metadata: OAuthMetadata) {

0 commit comments

Comments
 (0)