Skip to content

Commit 7eef434

Browse files
committed
Prefer response_uri for VPR domain before using client_id.
1 parent 530b0f9 commit 7eef434

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/convert.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ export async function toVpr({authorizationRequest, strict = false} = {}) {
108108
client_id,
109109
client_metadata,
110110
nonce,
111-
presentation_definition
111+
presentation_definition,
112+
response_uri
112113
} = authorizationRequest;
113114

114115
// disallow unsupported `submission_requirements` in strict mode
@@ -136,9 +137,9 @@ export async function toVpr({authorizationRequest, strict = false} = {}) {
136137
}
137138
}
138139

139-
// map `client_id` to `domain`
140-
if(client_id !== undefined) {
141-
verifiablePresentationRequest.domain = client_id;
140+
// map `response_uri` or `client_id` to `domain`
141+
if(response_uri !== undefined || client_id !== undefined) {
142+
verifiablePresentationRequest.domain = response_uri ?? client_id;
142143
}
143144

144145
// map `nonce` to `challenge`

0 commit comments

Comments
 (0)