Skip to content

Commit e2cae0c

Browse files
committed
chore: update deps
1 parent 4c313b1 commit e2cae0c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/client/lib/OpenID4VCIClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface OpenID4VCIClientState {
5353
authorizationRequestOpts?: AuthorizationRequestOpts;
5454
authorizationCodeResponse?: AuthorizationResponse;
5555
pkce: PKCEOpts;
56+
accessToken?: string;
5657
authorizationURL?: string;
5758
}
5859

@@ -67,6 +68,7 @@ export class OpenID4VCIClient {
6768
credentialIssuer,
6869
pkce,
6970
authorizationRequest,
71+
accessToken,
7072
jwk,
7173
endpointMetadata,
7274
accessTokenResponse,
@@ -82,6 +84,7 @@ export class OpenID4VCIClient {
8284
pkce?: PKCEOpts;
8385
authorizationRequest?: AuthorizationRequestOpts; // Can be provided here, or when manually calling createAuthorizationUrl
8486
jwk?: JWK;
87+
accessToken?: string;
8588
endpointMetadata?: EndpointMetadataResult;
8689
accessTokenResponse?: AccessTokenResponse;
8790
authorizationRequestOpts?: AuthorizationRequestOpts;
@@ -102,6 +105,7 @@ export class OpenID4VCIClient {
102105
pkce: { disabled: false, codeChallengeMethod: CodeChallengeMethod.S256, ...pkce },
103106
authorizationRequestOpts,
104107
authorizationCodeResponse,
108+
accessToken,
105109
jwk,
106110
endpointMetadata,
107111
accessTokenResponse,
@@ -317,6 +321,7 @@ export class OpenID4VCIClient {
317321
);
318322
}
319323
this._state.accessTokenResponse = response.successBody;
324+
this._state.accessToken = response.successBody.access_token
320325
}
321326

322327
return this.accessTokenResponse;
@@ -477,7 +482,7 @@ export class OpenID4VCIClient {
477482
request: NotificationRequest,
478483
accessToken?: string,
479484
): Promise<NotificationResult> {
480-
return sendNotification(credentialRequestOpts, request, accessToken ?? this.accessTokenResponse.access_token);
485+
return sendNotification(credentialRequestOpts, request, accessToken ?? (this.hasAccessTokenResponse() ? this.accessTokenResponse.access_token : this._state.accessToken));
481486
}
482487

483488
getCredentialOfferTypes(): string[][] {

0 commit comments

Comments
 (0)