fix handleevents not prompting auth for event publish with auth-required
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled

This commit is contained in:
2025-11-18 20:26:36 +00:00
parent d5c0e3abfc
commit d4fb6cbf49
15 changed files with 302 additions and 275 deletions

View File

@@ -93,21 +93,12 @@ func (n *N) ProcessDelete(ev *event.E, admins [][]byte) error {
continue
}
neo4jResult, ok := result.(interface {
Next(context.Context) bool
Record() *interface{}
Err() error
})
if !ok {
continue
}
if neo4jResult.Next(ctx) {
record := neo4jResult.Record()
if result.Next(ctx) {
record := result.Record()
if record != nil {
recordMap, ok := (*record).(map[string]any)
if ok {
if pubkeyStr, ok := recordMap["pubkey"].(string); ok {
pubkeyValue, found := record.Get("pubkey")
if found {
if pubkeyStr, ok := pubkeyValue.(string); ok {
pubkey, err := hex.Dec(pubkeyStr)
if err != nil {
continue
@@ -160,12 +151,7 @@ LIMIT 1`
return nil // Not deleted
}
neo4jResult, ok := result.(interface {
Next(context.Context) bool
Record() *interface{}
Err() error
})
if ok && neo4jResult.Next(ctx) {
if result.Next(ctx) {
return fmt.Errorf("event has been deleted")
}