@@ -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.
228233export 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