mirror of
https://github.com/believethehype/nostdress.git
synced 2026-07-12 02:08:10 -07:00
Added possibility to simply forward address to an exisiting one
This commit is contained in:
@@ -65,9 +65,12 @@ func SaveName(
|
||||
params.Name = name
|
||||
params.Domain = domain
|
||||
|
||||
// check if the given data works
|
||||
if inv, err = makeInvoice(params, 1000, &pin, "", ""); err != nil {
|
||||
return "", "", fmt.Errorf("couldn't make an invoice with the given data: %w", err)
|
||||
if params.Kind != "forward" {
|
||||
// check if the given data works
|
||||
if inv, err = makeInvoice(params, 1000, &pin, "", ""); err != nil {
|
||||
return "", "", fmt.Errorf("couldn't make an invoice with the given data: %w", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// save it
|
||||
|
||||
@@ -23,13 +23,16 @@
|
||||
<button class="copy-button" @click="copyToClipboard">
|
||||
{{ copied ? 'Copied!' : 'Copy Secret PIN' }}
|
||||
</button>
|
||||
<div v-if="invoice != ''">
|
||||
<div class="bold-small">
|
||||
To ensure the connection with your Lightning backend is configured
|
||||
properly, we've created a test invoice that can be seen below.
|
||||
</div>
|
||||
|
||||
<canvas id="qr"></canvas>
|
||||
<div class="code">{{ invoice }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources">
|
||||
<a class="resource-button" target="_blank" href="https://t.me/lnurl">
|
||||
Not working? Ask for help!
|
||||
|
||||
+17
@@ -56,9 +56,26 @@
|
||||
<option value="sparko">Sparko (CLN)</option>
|
||||
<option value="eclair">Eclair</option>
|
||||
<option value="lnpay">LNPay</option>
|
||||
<option value="forward">Forward</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div v-if="kind == 'forward'">
|
||||
<div class="field">
|
||||
<label for="host">
|
||||
Forward URl
|
||||
</label>
|
||||
<input
|
||||
class="input full-width"
|
||||
name="host"
|
||||
id="host"
|
||||
placeholder="https://walletofsatoshi.com/.well-known/lnurlp/ninthtractor31"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="kind == 'lnd'">
|
||||
<div class="field">
|
||||
<label for="host">
|
||||
|
||||
@@ -89,6 +89,11 @@ func handleLNURL(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if params.Kind == "forward" {
|
||||
http.Redirect(w, r, params.Host, http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
|
||||
log.Info().Str("username", username).Str("domain", domain).Msg("got lnurl request")
|
||||
|
||||
if amount := r.URL.Query().Get("amount"); amount == "" {
|
||||
|
||||
@@ -64,9 +64,12 @@ func handleNip05(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if s.Nip05 {
|
||||
middlestringtrim := middlestring[:len(middlestring)-2]
|
||||
middlestringtrim += "\n"
|
||||
response = firstpartstring + middlestringtrim + finalpartstring
|
||||
if len(middlestring) > 2 {
|
||||
middlestringtrim := middlestring[:len(middlestring)-2]
|
||||
|
||||
middlestringtrim += "\n"
|
||||
response = firstpartstring + middlestringtrim + finalpartstring
|
||||
}
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
|
||||
fmt.Fprintf(w, response)
|
||||
|
||||
Reference in New Issue
Block a user