@mattrglobal/verifier-sdk-web 2.0.3-unstable.47 → 2.0.3-unstable.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -493,13 +493,16 @@ const getHashParamValue = (hash, param) => {
493
493
  };
494
494
 
495
495
  const createSession = async ({credentialQuery: credentialQuery, challenge: challenge, redirectUri: redirectUri, apiBaseUrl: apiBaseUrl, walletProviderId: walletProviderId, dcApiSupported: dcApiSupported, applicationId: applicationId}) => {
496
+ const openid4VpConfiguration = !!walletProviderId || !!redirectUri ? {
497
+ redirectUri: redirectUri,
498
+ walletProviderId: walletProviderId
499
+ } : undefined;
496
500
  const postData = {
497
501
  credentialQuery: credentialQuery,
498
502
  challenge: challenge,
499
503
  applicationId: applicationId,
500
- redirectUri: redirectUri,
501
- walletProviderId: walletProviderId,
502
- dcApiSupported: dcApiSupported
504
+ dcApiSupported: dcApiSupported,
505
+ openid4VpConfiguration: openid4VpConfiguration
503
506
  };
504
507
  const responseResult = await safeFetch(`${apiBaseUrl}/v2/presentations/web/sessions`, {
505
508
  method: "POST",
@@ -772,8 +775,7 @@ const requestCredentialsWithDigitalCredentialsApi = async options => {
772
775
  sessionId: sessionId,
773
776
  sessionKey: sessionKey,
774
777
  challenge: challenge,
775
- protocol: parsedCredentialResponse.protocol,
776
- data: parsedCredentialResponse.data
778
+ response: parsedCredentialResponse
777
779
  });
778
780
  if (credentialVerificationResult.isErr()) {
779
781
  return neverthrow.err({
@@ -852,12 +854,10 @@ const parseCredentialResponse = credentialResponse => {
852
854
  };
853
855
 
854
856
  const verifyCredentialResponse = async options => {
855
- const {apiBaseUrl: apiBaseUrl, sessionId: sessionId, sessionKey: sessionKey, challenge: challenge, protocol: protocol, data: data} = options;
856
- const requestBody = {
857
- protocol: protocol,
858
- data: data,
857
+ const {apiBaseUrl: apiBaseUrl, sessionId: sessionId, sessionKey: sessionKey, challenge: challenge, response: response} = options;
858
+ const requestBody = Object.assign(Object.assign({}, response), {
859
859
  challenge: challenge
860
- };
860
+ });
861
861
  const credentialVerificationResult = await safeFetch(`${apiBaseUrl}/v2/presentations/web/sessions/${sessionId}/dc-api/response`, {
862
862
  method: "POST",
863
863
  headers: {