fixed panic when there is no "relay" tag

This commit is contained in:
pippellia-btc 2025-05-05 16:31:23 +02:00 committed by fiatjaf_
parent 57683d4cae
commit 1e42994d7f

View File

@ -48,7 +48,12 @@ func ValidateAuthEvent(event *nostr.Event, challenge string, relayURL string) (p
return "", false
}
found, err := parseURL(event.Tags.GetFirst([]string{"relay", ""}).Value())
tag := event.Tags.Find("relay")
if tag == nil {
return "", false
}
found, err := parseURL(tag[1])
if err != nil {
return "", false
}