Handle missing XMPP_VCARD_SERVER_DOMAIN

This commit is contained in:
Yarmo Mackenbach 2020-10-24 11:44:40 +02:00
parent 8a7f60d24b
commit 2521225a9b

View file

@ -1,6 +1,7 @@
const reURI = /^xmpp:([a-zA-Z0-9\.\-\_]*)@([a-zA-Z0-9\.\-\_]*)(?:\?(.*))?/
const processURI = (uri, opts) => {
if (!opts) { opts = {} }
const match = uri.match(reURI)
return {
@ -10,7 +11,9 @@ const processURI = (uri, opts) => {
uri: uri
},
proof: {
uri: `https://${opts.XMPP_VCARD_SERVER_DOMAIN}/api/vcard/${output.display}/DESC`,
uri: 'XMPP_VCARD_SERVER_DOMAIN' in opts
? `https://${opts.XMPP_VCARD_SERVER_DOMAIN}/api/vcard/${output.display}/DESC`
: null,
fetch: null
},
qr: null