@@ -38,7 +38,7 @@ const debug = Debug('sphereon:oid4vci');
3838
3939export interface OpenID4VCIClientState {
4040 credentialIssuer : string ;
41- credentialOffer ?: CredentialOfferRequestWithBaseUrl
41+ credentialOffer ?: CredentialOfferRequestWithBaseUrl ;
4242 clientId ?: string ;
4343 kid ?: string ;
4444 jwk ?: JWK ;
@@ -65,7 +65,7 @@ export class OpenID4VCIClient {
6565 endpointMetadata,
6666 accessTokenResponse,
6767 authorizationRequestOpts,
68- authorizationURL
68+ authorizationURL,
6969 } : {
7070 credentialOffer ?: CredentialOfferRequestWithBaseUrl ;
7171 kid ?: string ;
@@ -96,11 +96,11 @@ export class OpenID4VCIClient {
9696 jwk,
9797 endpointMetadata,
9898 accessTokenResponse,
99- authorizationURL
100- }
99+ authorizationURL,
100+ } ;
101101 // Running syncAuthorizationRequestOpts later as it is using the state
102102 if ( ! this . _state . authorizationRequestOpts ) {
103- this . _state . authorizationRequestOpts = this . syncAuthorizationRequestOpts ( authorizationRequest )
103+ this . _state . authorizationRequestOpts = this . syncAuthorizationRequestOpts ( authorizationRequest ) ;
104104 }
105105 debug ( `Authorization req options: ${ JSON . stringify ( this . _state . authorizationRequestOpts , null , 2 ) } ` ) ;
106106 }
@@ -141,8 +141,8 @@ export class OpenID4VCIClient {
141141 return client ;
142142 }
143143
144- public static async fromState ( { state } : { state : OpenID4VCIClientState | string } ) : Promise < OpenID4VCIClient > {
145- const clientState = typeof state === 'string' ? JSON . parse ( state ) : state
144+ public static async fromState ( { state } : { state : OpenID4VCIClientState | string } ) : Promise < OpenID4VCIClient > {
145+ const clientState = typeof state === 'string' ? JSON . parse ( state ) : state ;
146146
147147 return new OpenID4VCIClient ( clientState ) ;
148148 }
@@ -208,7 +208,10 @@ export class OpenID4VCIClient {
208208
209209 // todo: Probably can go with current logic in MetadataClient who will always set the authorization_endpoint when found
210210 // handling this because of the support for v1_0-08
211- if ( this . _state . endpointMetadata ?. credentialIssuerMetadata && 'authorization_endpoint' in this . _state . endpointMetadata . credentialIssuerMetadata ) {
211+ if (
212+ this . _state . endpointMetadata ?. credentialIssuerMetadata &&
213+ 'authorization_endpoint' in this . _state . endpointMetadata . credentialIssuerMetadata
214+ ) {
212215 this . _state . endpointMetadata . authorization_endpoint = this . _state . endpointMetadata . credentialIssuerMetadata . authorization_endpoint as string ;
213216 }
214217 this . _state . authorizationURL = await createAuthorizationRequestUrl ( {
@@ -424,7 +427,7 @@ export class OpenID4VCIClient {
424427 }
425428
426429 public async exportState ( ) : Promise < string > {
427- return JSON . stringify ( this . _state )
430+ return JSON . stringify ( this . _state ) ;
428431 }
429432
430433 // FIXME: We really should convert <v11 to v12 objects first. Right now the logic doesn't map nicely and is brittle.
0 commit comments