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 = ({
155
155
const clientInformation = await validateClientInformation ( provider ) ;
156
156
updateAuthState ( { oauthStep : "authorization_redirect" } ) ;
157
157
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
+ }
158
163
const { authorizationUrl, codeVerifier } = await startAuthorization (
159
164
sseUrl ,
160
165
{
161
166
metadata,
162
167
clientInformation,
163
168
redirectUrl : provider . redirectUrl ,
169
+ scope,
164
170
} ,
165
171
) ;
166
172
167
173
provider . saveCodeVerifier ( codeVerifier ) ;
168
174
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
+ } ) ;
178
179
} catch ( error ) {
179
180
console . error ( "OAuth flow step error:" , error ) ;
180
181
throw new Error (
You can’t perform that action at this time.
0 commit comments