@@ -117,9 +117,14 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
117
117
return window . location . origin + "/oauth/callback" ;
118
118
}
119
119
120
+ get debugRedirectUrl ( ) {
121
+ return window . location . origin + "/oauth/callback/debug" ;
122
+ }
123
+
120
124
get clientMetadata ( ) : OAuthClientMetadata {
125
+ // Register both redirect URIs to support both normal and debug flows
121
126
return {
122
- redirect_uris : [ this . redirectUrl ] ,
127
+ redirect_uris : [ this . redirectUrl , this . debugRedirectUrl ] ,
123
128
token_endpoint_auth_method : "none" ,
124
129
grant_types : [ "authorization_code" , "refresh_token" ] ,
125
130
response_types : [ "code" ] ,
@@ -223,11 +228,13 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
223
228
}
224
229
}
225
230
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
227
232
// display in debug UI.
228
233
export class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
229
234
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 ;
231
238
}
232
239
233
240
saveServerMetadata ( metadata : OAuthMetadata ) {
0 commit comments