File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -189,25 +189,22 @@ export default {
189189 let protocols;
190190 const url = new URL (text);
191191 getRequestOrigin (url);
192- const isVcApi = url .pathname .includes (' /exchangers/' );
193- const isOpenId = url .protocol .includes (' openid-credential-offer' );
194- const multipleProtocols = url .pathname .includes (' /interactions/' );
195- if (multipleProtocols) {
192+ const multiProtocol = url .protocol === ' https:' ;
193+ const isOpenId = url .protocol === ' openid-credential-offer:' ;
194+ if (multiProtocol) {
196195 const headers = {headers: {accept: ' application/json' }};
197196 const {data } = await httpClient .get (text, {headers});
198197 protocols = data .protocols ;
199198 } else if (isOpenId) {
200199 protocols = {OID4VCI : text};
201- } else if (isVcApi) {
202- protocols = {vcapi: text};
203200 }
204201 if (! protocols) {
205202 throw new Error (' Unable to handle scanned QR code.' );
206203 }
207204 const event = {
205+ type: ' credentialrequest' ,
208206 credential: {options: {protocols}},
209207 credentialRequestOptions: {web: {protocols}},
210- type: ' credentialrequest'
211208 };
212209 const promise = new Promise (res => event .respondWith = res);
213210 result .value = {type, text, event };
You can’t perform that action at this time.
0 commit comments