@digitalbazaar/oid4-client 3.4.1 → 3.5.0
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.
- package/lib/oid4vp.js +3 -2
- package/package.json +1 -1
package/lib/oid4vp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
|
|
2
|
+
* Copyright (c) 2023-2024 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import {assert, assertOptional, fetchJSON} from './util.js';
|
|
5
5
|
import {decodeJwt} from 'jose';
|
|
@@ -159,6 +159,7 @@ export async function sendAuthorizationResponse({
|
|
|
159
159
|
verifiablePresentation,
|
|
160
160
|
presentationSubmission,
|
|
161
161
|
authorizationRequest,
|
|
162
|
+
vpToken,
|
|
162
163
|
agent
|
|
163
164
|
} = {}) {
|
|
164
165
|
try {
|
|
@@ -174,7 +175,7 @@ export async function sendAuthorizationResponse({
|
|
|
174
175
|
|
|
175
176
|
// send VP and presentation submission to complete exchange
|
|
176
177
|
const body = new URLSearchParams();
|
|
177
|
-
body.set('vp_token', JSON.stringify(verifiablePresentation));
|
|
178
|
+
body.set('vp_token', vpToken ?? JSON.stringify(verifiablePresentation));
|
|
178
179
|
body.set('presentation_submission', JSON.stringify(presentationSubmission));
|
|
179
180
|
const response = await httpClient.post(authorizationRequest.response_uri, {
|
|
180
181
|
agent, body, headers: {accept: 'application/json'},
|