@@ -32,19 +32,14 @@ import {
3232 toUniformCredentialOfferRequest ,
3333 TYP_ERROR ,
3434 UniformCredentialRequest ,
35- URIState
35+ URIState ,
3636} from '@sphereon/oid4vci-common'
3737import { CompactSdJwtVc , CredentialMapper , W3CVerifiableCredential } from '@sphereon/ssi-types'
3838import { v4 } from 'uuid'
3939
4040import { assertValidPinNumber , createCredentialOfferObject , createCredentialOfferURIFromObject } from './functions'
4141import { LookupStateManager } from './state-manager'
42- import {
43- CredentialDataSupplier ,
44- CredentialDataSupplierArgs ,
45- CredentialIssuanceInput ,
46- CredentialSignerCallback
47- } from './types'
42+ import { CredentialDataSupplier , CredentialDataSupplierArgs , CredentialIssuanceInput , CredentialSignerCallback } from './types'
4843
4944const SECOND = 1000
5045
@@ -350,17 +345,17 @@ export class VcIssuer<DIDDoc extends object> {
350345 throw new Error ( CREDENTIAL_MISSING_ERROR )
351346 }
352347 // remove the previous nonce
353- this . cNonces . delete ( cNonceState . cNonce )
348+ await this . cNonces . delete ( cNonceState . cNonce )
354349
355350 if ( preAuthorizedCode && preAuthSession ) {
356351 preAuthSession . lastUpdatedAt = + new Date ( )
357352 preAuthSession . status = IssueStatus . CREDENTIAL_ISSUED
358- this . _credentialOfferSessions . set ( preAuthorizedCode , preAuthSession )
353+ await this . _credentialOfferSessions . set ( preAuthorizedCode , preAuthSession )
359354 } else if ( issuerState && authSession ) {
360355 // If both were set we used the pre auth flow above as well, hence the else if
361356 authSession . lastUpdatedAt = + new Date ( )
362357 authSession . status = IssueStatus . CREDENTIAL_ISSUED
363- this . _credentialOfferSessions . set ( issuerState , authSession )
358+ await this . _credentialOfferSessions . set ( issuerState , authSession )
364359 }
365360
366361 return {
@@ -390,7 +385,7 @@ export class VcIssuer<DIDDoc extends object> {
390385 preAuthSession . lastUpdatedAt = + new Date ( )
391386 preAuthSession . status = IssueStatus . ERROR
392387 preAuthSession . error = error instanceof Error ? error . message : error ?. toString ( )
393- this . _credentialOfferSessions . set ( preAuthorizedCode , preAuthSession )
388+ await this . _credentialOfferSessions . set ( preAuthorizedCode , preAuthSession )
394389 }
395390 }
396391 if ( issuerState ) {
@@ -399,7 +394,7 @@ export class VcIssuer<DIDDoc extends object> {
399394 authSession . lastUpdatedAt = + new Date ( )
400395 authSession . status = IssueStatus . ERROR
401396 authSession . error = error instanceof Error ? error . message : error ?. toString ( )
402- this . _credentialOfferSessions . set ( issuerState , authSession )
397+ await this . _credentialOfferSessions . set ( issuerState , authSession )
403398 }
404399 }
405400 }
0 commit comments