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