File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/WalletFramework.Oid4Vc/Oid4Vp/Services Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -281,10 +281,24 @@ public async Task<Option<Uri>> AcceptAuthorizationRequest(
281
281
switch ( credential . Credential )
282
282
{
283
283
case SdJwtRecord { OneTimeUse : true } sdJwtRecord :
284
- await _sdJwtVcHolderService . DeleteAsync ( context , sdJwtRecord . GetId ( ) ) ;
284
+ var credentialSetSdJwtRecords = await _sdJwtVcHolderService . ListAsync ( context , sdJwtRecord . GetCredentialSetId ( ) ) ;
285
+ await credentialSetSdJwtRecords . Match (
286
+ async sdJwtRecords =>
287
+ {
288
+ if ( sdJwtRecords . Count ( ) > 1 )
289
+ await _sdJwtVcHolderService . DeleteAsync ( context , sdJwtRecord . GetId ( ) ) ;
290
+ } ,
291
+ ( ) => Task . CompletedTask ) ;
285
292
break ;
286
293
case MdocRecord { OneTimeUse : true } mDocRecord :
287
- await _mDocStorage . Delete ( mDocRecord ) ;
294
+ var credentialSetMdocRecords = await _mDocStorage . List ( mDocRecord . GetCredentialSetId ( ) ) ;
295
+ await credentialSetMdocRecords . Match (
296
+ async mDocRecords =>
297
+ {
298
+ if ( mDocRecords . Count ( ) > 1 )
299
+ await _mDocStorage . Delete ( mDocRecord ) ;
300
+ } ,
301
+ ( ) => Task . CompletedTask ) ;
288
302
break ;
289
303
}
290
304
}
You can’t perform that action at this time.
0 commit comments