diff --git a/models.py b/models.py
index ca744cb..59d800e 100644
--- a/models.py
+++ b/models.py
@@ -5,7 +5,7 @@ from fastapi import Query, Request
from lnurl import Lnurl
from lnurl import encode as lnurl_encode
from lnurl.types import LnurlPayMetadata
-from pydantic import BaseModel
+from pydantic import BaseModel, Field
ZERO_KEY = "00000000000000000000000000000000"
@@ -71,3 +71,8 @@ class Refund(BaseModel):
hit_id: str
refund_amount: int
time: datetime
+
+
+class UIDPost(BaseModel):
+ UID: str = Field(None, description="The UID of the card.")
+ LNURLW: str = Field(None, description="The LNURLW of the card.")
diff --git a/static/js/index.js b/static/js/index.js
index 2208189..b553347 100644
--- a/static/js/index.js
+++ b/static/js/index.js
@@ -148,6 +148,15 @@ window.app = Vue.createApp({
}
}
},
+ computed: {
+ deeplinkUrl() {
+ const baseUrl = `boltcard://${this.qrCodeDialog.wipe ? 'reset' : 'program'}`
+ const url =
+ this.qrCodeDialog.data.link +
+ (this.qrCodeDialog.wipe ? '&wipe=true' : '')
+ return `${baseUrl}?url=${encodeURIComponent(url)}`
+ }
+ },
methods: {
readNfcTag() {
const ndef = new NDEFReader()
@@ -229,6 +238,9 @@ window.app = Vue.createApp({
this.qrCodeDialog.data = {
id: card.id,
link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp,
+ encodedURI: encodeURIComponent(
+ window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp
+ ),
name: card.card_name,
uid: card.uid,
external_id: card.external_id,
diff --git a/templates/boltcards/index.html b/templates/boltcards/index.html
index 838eefb..cd63021 100644
--- a/templates/boltcards/index.html
+++ b/templates/boltcards/index.html
@@ -463,6 +463,7 @@