Skip to content

Commit a73afee

Browse files
author
Linas Išganaitis
committed
Add client_id only if it was provided during client initialization
1 parent 52f715f commit a73afee

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

packages/client/lib/OpenID4VCIClient.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,17 @@ export class OpenID4VCIClient {
116116

117117
const queryObj: { [key: string]: string } = {
118118
response_type: ResponseType.AUTH_CODE,
119-
client_id: this.clientId || '',
120119
code_challenge_method: codeChallengeMethod,
121120
code_challenge: codeChallenge,
122121
authorization_details: JSON.stringify(this.handleAuthorizationDetails(authorizationDetails)),
123122
redirect_uri: redirectUri,
124123
scope: scope,
125124
};
126125

126+
if (this.clientId) {
127+
queryObj['client_id'] = this.clientId;
128+
}
129+
127130
if (this.credentialOffer.issuerState) {
128131
queryObj['issuer_state'] = this.credentialOffer.issuerState;
129132
}
@@ -167,14 +170,17 @@ export class OpenID4VCIClient {
167170

168171
const queryObj: { [key: string]: string } = {
169172
response_type: ResponseType.AUTH_CODE,
170-
client_id: this.clientId || '',
171173
code_challenge_method: codeChallengeMethod,
172174
code_challenge: codeChallenge,
173175
authorization_details: JSON.stringify(this.handleAuthorizationDetails(authorizationDetails)),
174176
redirect_uri: redirectUri,
175177
scope: scope,
176178
};
177179

180+
if (this.clientId) {
181+
queryObj['client_id'] = this.clientId;
182+
}
183+
178184
if (this.credentialOffer.issuerState) {
179185
queryObj['issuer_state'] = this.credentialOffer.issuerState;
180186
}

0 commit comments

Comments
 (0)