bank: account QR encodes payto (was wrong webui homepage)
Was broken: after Create my bank account the QR encoded only https://bank.hacktivism.ch/webui/, not the new account. Also payto wrongly forced :443 while libeufin issues host without port. Now: prefer bank internal_payto_uri; QR + blue link = payto:// of the account; webui stays a separate login button.
This commit is contained in:
parent
2fb060f79a
commit
d391b42c52
3 changed files with 62 additions and 40 deletions
|
|
@ -1348,8 +1348,8 @@ tw balance</pre>
|
|||
<div class="goa-pay-taler-qr__inner" id="qr-auto-acct"></div>
|
||||
<img class="goa-pay-taler-qr__logo" id="qr-auto-acct-logo" alt="" />
|
||||
</div>
|
||||
<div class="qr-label" id="qr-auto-acct-label">Your account · bank UI login</div>
|
||||
<a class="meta-uri" id="qr-auto-acct-payload" href="https://bank.hacktivism.ch/webui/" target="_blank" rel="noopener noreferrer">https://bank.hacktivism.ch/webui/</a>
|
||||
<div class="qr-label" id="qr-auto-acct-label">Your account · payto</div>
|
||||
<a class="meta-uri" id="qr-auto-acct-payload" href="#">—</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1776,8 +1776,8 @@ tw balance</pre>
|
|||
webuiA.setAttribute("target", "_blank");
|
||||
webuiA.setAttribute("rel", "noopener noreferrer");
|
||||
}
|
||||
/* payto must include host:port (e.g. bank.hacktivism.ch:443) */
|
||||
var payto = d.payto_uri || "";
|
||||
/* Account payto (libeufin style) — this is what the account QR encodes */
|
||||
var payto = d.payto_uri || d.qr_payload || "";
|
||||
if (payA) {
|
||||
if (payto && payto.indexOf("payto://") === 0) {
|
||||
payA.href = payto;
|
||||
|
|
@ -1793,26 +1793,31 @@ tw balance</pre>
|
|||
st.textContent =
|
||||
"Account created for you · " +
|
||||
(d.username || d.name || "") +
|
||||
" · save username & password";
|
||||
" · save username & password · QR = payto account";
|
||||
}
|
||||
/* Fancy QR_Taler: encode bank UI URL (login with credentials above) */
|
||||
/* QR encodes payto:// of this account (not the generic webui homepage) */
|
||||
var qrBlock = document.getElementById("auto-account-qr-block");
|
||||
var qrLabel = document.getElementById("qr-auto-acct-label");
|
||||
var qrPayload = payto || webui;
|
||||
if (qrBlock) qrBlock.hidden = false;
|
||||
if (qrLabel) {
|
||||
qrLabel.textContent =
|
||||
"QR_Taler · open bank UI · login as " + (d.username || "you");
|
||||
"Account payto · " + (d.username || "you");
|
||||
}
|
||||
var autoPayload = document.getElementById("qr-auto-acct-payload");
|
||||
if (autoPayload) {
|
||||
autoPayload.href = webui;
|
||||
autoPayload.textContent = webui;
|
||||
autoPayload.setAttribute("target", "_blank");
|
||||
autoPayload.setAttribute("rel", "noopener noreferrer");
|
||||
autoPayload.href = qrPayload;
|
||||
autoPayload.textContent = qrPayload;
|
||||
if (qrPayload.indexOf("http") === 0) {
|
||||
autoPayload.setAttribute("target", "_blank");
|
||||
autoPayload.setAttribute("rel", "noopener noreferrer");
|
||||
} else {
|
||||
autoPayload.removeAttribute("target");
|
||||
}
|
||||
}
|
||||
makeQr(
|
||||
document.getElementById("qr-auto-acct"),
|
||||
webui,
|
||||
qrPayload,
|
||||
document.getElementById("qr-auto-acct-logo")
|
||||
);
|
||||
if (btn) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue