From 23863c94bb93feeb681b126e16f2d2abfb34652f Mon Sep 17 00:00:00 2001 From: Dolu Date: Sat, 28 Jan 2023 15:28:41 +0100 Subject: [PATCH] feat: add `keyauth://` support --- index.html | 2 +- package.json | 2 +- src/components/zerologin.ce.vue | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 4269f66..1c7c338 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@
- +
diff --git a/package.json b/package.json index 37616c0..498bc32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@zerologin/elements", "description": "Zerologin auth web component", - "version": "0.0.8-beta", + "version": "0.0.9-beta", "private": false, "files": [ "dist/" diff --git a/src/components/zerologin.ce.vue b/src/components/zerologin.ce.vue index 4653209..4fc9747 100644 --- a/src/components/zerologin.ce.vue +++ b/src/components/zerologin.ce.vue @@ -72,6 +72,7 @@ function copy() { } async function clickToConnect() { + console.log(lnurl.value); if (weblnSupported.value) { // @ts-ignore await window.webln.enable(); @@ -82,7 +83,11 @@ async function clickToConnect() { console.error(e); } } else { - window.open(`lightning:${lnurl.value}`, "_self"); + let url = lnurl.value; + if (!lnurl.value.startsWith("keyauth://")) { + url = `lightning:${lnurl.value}`; + } + window.open(`${url}`, "_self"); } }