From 0e283368ed1a1c0bafd43dc880442753df66e9a1 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 11 Jan 2026 17:43:54 -0300 Subject: [PATCH] bunker: authorize preexisting keys first. --- bunker.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bunker.go b/bunker.go index 1a5b2bd..fbab99b 100644 --- a/bunker.go +++ b/bunker.go @@ -329,6 +329,10 @@ var bunker = &cli.Command{ // asking user for authorization signer.AuthorizeRequest = func(harmless bool, from nostr.PubKey, secret string) bool { + if slices.Contains(config.AuthorizedKeys, from) || slices.Contains(authorizedSecrets, secret) { + return true + } + if secret == newSecret { // store this key config.AuthorizedKeys = appendUnique(config.AuthorizedKeys, from) @@ -343,9 +347,11 @@ var bunker = &cli.Command{ if persist != nil { persist() } + + return true } - return slices.Contains(config.AuthorizedKeys, from) || slices.Contains(authorizedSecrets, secret) + return false } for ie := range events {