Skip to content

Commit

Permalink
chore: generate new client id when client has none
Browse files Browse the repository at this point in the history
  • Loading branch information
Brummos committed Jan 21, 2025
1 parent 4972075 commit 0d31428
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { OpenID4VCIClient } from '@sphereon/oid4vci-client'
import { AuthorizationChallengeValidationResponse } from '@sphereon/ssi-sdk.siopv2-oid4vp-common'
import { AuthorizationChallengeCodeResponse } from '@sphereon/oid4vci-common'
import { CreateConfigResult } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth'
import { v4 as uuidv4 } from 'uuid'
import { RequiredContext } from '../types/IOID4VCIHolder'
import {
CreateConfigArgs,
Expand All @@ -16,7 +17,7 @@ export const sendAuthorizationChallengeRequest = async (args: SendAuthorizationC

const oid4vciClient = await OpenID4VCIClient.fromState({ state: openID4VCIClientState })
return oid4vciClient.acquireAuthorizationChallengeCode({
clientId: oid4vciClient.clientId,
clientId: oid4vciClient.clientId ?? uuidv4(),
...(authSession && { authSession }),
...(presentationDuringIssuanceSession && { presentationDuringIssuanceSession })
})
Expand Down

0 comments on commit 0d31428

Please sign in to comment.