From 9933bb7865923e4672b1228c83cb3f25e262a9a4 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 6 Sep 2025 22:29:35 -0300 Subject: [PATCH] khatru: fix multi-user auth stupid bug. --- khatru/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/khatru/handlers.go b/khatru/handlers.go index d48f794..0795785 100644 --- a/khatru/handlers.go +++ b/khatru/handlers.go @@ -320,7 +320,7 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) { wsBaseUrl := strings.Replace(rl.getBaseURL(r), "http", "ws", 1) if pubkey, ok := nip42.ValidateAuthEvent(env.Event, ws.Challenge, wsBaseUrl); ok { - total := len(ws.AuthedPublicKeys) - 1 + total := len(ws.AuthedPublicKeys) ws.authLock.Lock() if idx := slices.Index(ws.AuthedPublicKeys, pubkey); idx == -1 { // this public key is not authenticated