commit f69e171abf813701cb108fef8e723b7ad65d060b
parent 4895eb9909a2e729399c2fac2b909cf35a8956c6
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Thu, 22 Oct 2026 12:45:38 +0200
allow to propose target URI in lookup result handler
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/pkg/taldir/taldir.go b/pkg/taldir/taldir.go
@@ -696,6 +696,12 @@ func (t *Taldir) configResponse(w http.ResponseWriter, r *http.Request) {
}
// Sort the slice by name alphabetically
sort.Slice(meths, func(i,j int) bool {
+ if meths[j].Name == "mail" {
+ return true
+ }
+ if meths[j].Name == "phone" {
+ return true
+ }
return meths[i].Name < meths[i].Name
})
cfg := VersionResponse{
@@ -919,6 +925,7 @@ func (t *Taldir) typeLookupResultPage(w http.ResponseWriter, r *http.Request) {
fullData := map[string]any{
"version": t.Cfg.Version,
"qrCode": template.URL("data:image/png;base64," + encodedPng),
+ "proposedTargetUri": r.URL.Query().Get("targetUri"),
"talerAddContactURI": template.URL(talerAddContactURI),
"available": !found,
"alias_type": val.Name(),
diff --git a/web/templates/lookup_result.html b/web/templates/lookup_result.html
@@ -51,7 +51,7 @@
<div class="row">
<div class="col-lg-8 offset-lg-2 text-center">
<div id="address-input-group" class="input-group mb-3">
- <input id="uriInput" name="target_uri" type="text" class="form-control" placeholder="{{ call .tr "talerMailboxAddressExample" }}" aria-label="Default" aria-describedby="inputGroup-sizing-default">
+ <input id="uriInput" name="target_uri" type="text" class="form-control" placeholder="{{ call .tr "talerMailboxAddressExample" }}" value="{{.proposedTargetUri}}" aria-label="Default" aria-describedby="inputGroup-sizing-default">
<input class="input-group-text btn btn-outline-primary" type="submit" value="{{ call .tr "linkIt" }}">
</div>
<a class="btn btn-outline-primary mb-3" id="login-button" hidden>Start OpenID validation</a>