File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -605,16 +605,24 @@ export class CpOidcClient extends SpcpOidcBaseClient {
605605 baseClient . issuer . metadata . authorization_endpoint
606606
607607 if ( ! authorizationEndpoint ) {
608- throw new CreateParRequestError (
608+ throw new CreateAuthorisationUrlError (
609609 'Authorization endpoint not found in issuer metadata' ,
610610 )
611611 }
612612
613- const authorisationUrl = `${ authorizationEndpoint } ?client_id=${ encodeURIComponent ( this . rpClientId ) } &request_uri=${ encodeURIComponent ( data . request_uri ) } `
613+ const authorisationUrlParams = new URLSearchParams ( {
614+ client_id : this . rpClientId ,
615+ request_uri : data . request_uri ,
616+ } )
617+
618+ const authorisationUrl = `${ authorizationEndpoint } ?${ authorisationUrlParams . toString ( ) } `
614619
615620 return authorisationUrl
616621 } catch ( err ) {
617- if ( err instanceof CreateParRequestError ) {
622+ if (
623+ err instanceof CreateParRequestError ||
624+ err instanceof CreateAuthorisationUrlError
625+ ) {
618626 throw err
619627 }
620628 throw new CreateParRequestError (
You can’t perform that action at this time.
0 commit comments