authHandler bugfix from ben at nostr:nevent1qqsy9nka36av9ukvkyq42626t7gkyu4rdkgsu0c785kprup3a2694ngkkwvrk

This commit is contained in:
fiatjaf
2026-02-01 16:52:53 -03:00
parent d87066c9b9
commit e17995d427

View File

@@ -190,9 +190,11 @@ func (r *Relay) handleMessage(message string) {
} }
r.challenge = *env.Challenge r.challenge = *env.Challenge
if r.authHandler != nil { if r.authHandler != nil {
r.Auth(r.Context(), func(ctx context.Context, evt *Event) error { go func() {
return r.authHandler(ctx, r, evt) r.Auth(r.Context(), func(ctx context.Context, evt *Event) error {
}) return r.authHandler(ctx, r, evt)
})
}()
} }
case *EventEnvelope: case *EventEnvelope:
// we already have the subscription from the pre-check above, so we can just reuse it // we already have the subscription from the pre-check above, so we can just reuse it