File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -155,26 +155,27 @@ const AuthDebugger = ({
155155 const clientInformation = await validateClientInformation ( provider ) ;
156156 updateAuthState ( { oauthStep : "authorization_redirect" } ) ;
157157 try {
158+ let scope : string | undefined = undefined ;
159+ if ( metadata . scopes_supported ) {
160+ // Request all supported scopes during debugging
161+ scope = metadata . scopes_supported . join ( " " ) ;
162+ }
158163 const { authorizationUrl, codeVerifier } = await startAuthorization (
159164 sseUrl ,
160165 {
161166 metadata,
162167 clientInformation,
163168 redirectUrl : provider . redirectUrl ,
169+ scope,
164170 } ,
165171 ) ;
166172
167173 provider . saveCodeVerifier ( codeVerifier ) ;
168174
169- if ( metadata . scopes_supported ) {
170- const url = new URL ( authorizationUrl . toString ( ) ) ;
171- url . searchParams . set ( "scope" , metadata . scopes_supported . join ( " " ) ) ;
172- updateAuthState ( { authorizationUrl : url . toString ( ) } ) ;
173- } else {
174- updateAuthState ( { authorizationUrl : authorizationUrl . toString ( ) } ) ;
175- }
176-
177- updateAuthState ( { oauthStep : "authorization_code" } ) ;
175+ updateAuthState ( {
176+ authorizationUrl : authorizationUrl . toString ( ) ,
177+ oauthStep : "authorization_code" ,
178+ } ) ;
178179 } catch ( error ) {
179180 console . error ( "OAuth flow step error:" , error ) ;
180181 throw new Error (
You can’t perform that action at this time.
0 commit comments