Skip to content

Commit

Permalink
chore: Use calculated codeVerifier when acquiring the access token
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jan 23, 2024
1 parent 99f55c2 commit ea31c2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/client/lib/OpenID4VCIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ export class OpenID4VCIClient {
code?: string;
redirectUri?: string;
}): Promise<AccessTokenResponse> {
const { pin, clientId, codeVerifier, code, redirectUri } = opts ?? {};
const { pin, clientId, code, redirectUri } = opts ?? {};

if (opts?.codeVerifier) {
this._pkce.codeVerifier = opts.codeVerifier;
}
this.assertIssuerData();

if (clientId) {
Expand All @@ -266,7 +269,7 @@ export class OpenID4VCIClient {
metadata: this.endpointMetadata,
credentialIssuer: this.getIssuer(),
pin,
codeVerifier,
...(!this._pkce.disabled && { codeVerifier: this._pkce.codeVerifier }),
code,
redirectUri,
asOpts: { clientId },
Expand Down

0 comments on commit ea31c2b

Please sign in to comment.