Skip to content

Commit 94d98ec

Browse files
authored
Merge pull request #1173 from asoorm/fix/930-redirect-uri-mismatch
fix: ensure DCR always registers both redirect URIs
2 parents 7c8b031 + abe1cf9 commit 94d98ec

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

client/src/lib/auth.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,15 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
146146
}
147147

148148
get redirect_uris() {
149-
// Normally register both redirect URIs to support both normal and debug flows
150-
// In debug subclass, redirectUrl may be the same as debugRedirectUrl, so remove duplicates
149+
// Always register both redirect URIs to support both normal and debug flows.
150+
// Use the base URLs directly (not this.redirectUrl) to avoid the debug subclass
151+
// override collapsing both URIs into one, which causes the normal flow's
152+
// /authorize request to use an unregistered redirect_uri.
151153
// See: https://github.com/modelcontextprotocol/inspector/issues/825
152-
return [...new Set([this.redirectUrl, this.debugRedirectUrl])];
154+
// See: https://github.com/modelcontextprotocol/inspector/issues/930
155+
const callbackUrl = window.location.origin + "/oauth/callback";
156+
const debugCallbackUrl = window.location.origin + "/oauth/callback/debug";
157+
return [callbackUrl, debugCallbackUrl];
153158
}
154159

155160
get clientMetadata(): OAuthClientMetadata {

0 commit comments

Comments
 (0)