From 2521225a9b7aad949f0dee1ee3bd73aa24e222a9 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 24 Oct 2020 11:44:40 +0200 Subject: [PATCH] Handle missing XMPP_VCARD_SERVER_DOMAIN --- src/serviceproviders/xmpp.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serviceproviders/xmpp.js b/src/serviceproviders/xmpp.js index 1762e7c..5ab54c2 100644 --- a/src/serviceproviders/xmpp.js +++ b/src/serviceproviders/xmpp.js @@ -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