Skip to content

Commit 4a87335

Browse files
jameseasterdlongley
authored andcommitted
Remove vcapi conditional.
1 parent 64c1131 commit 4a87335

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

routes/ScannerExchangePage.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff 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};

0 commit comments

Comments
 (0)