Skip to content

Commit

Permalink
chore: fix state issue with VCV issuance
Browse files Browse the repository at this point in the history
  • Loading branch information
coodos committed Nov 4, 2024
1 parent 128aa74 commit eebe78b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions apps/server/src/modules/oid4vc/oid4vc.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ export class Oid4vcController {
pinRequired: false,
},
{
experienceId: experienceId.id,
state: session.id,
state: `${experienceId}::${session.id}`,
},
);
const offerExists = await this.credOfferService.findById(experienceId);
Expand Down Expand Up @@ -246,12 +245,10 @@ export class Oid4vcController {
policies: { aud: false },
resolver,
});
const experience = await this.experienceService.findById(
payload.experienceId,
{
cv: { user: true },
},
);
const [experienceId, sessionId] = payload.state.split('::');
const experience = await this.experienceService.findById(experienceId, {
cv: { user: true },
});
if (experience.status !== 'approved')
throw new BadRequestException('experience not approved');
const identity = await this.identityService.getAdminDid();
Expand Down

0 comments on commit eebe78b

Please sign in to comment.