fixes and tweaks from nak port work.

This commit is contained in:
fiatjaf
2025-04-21 08:35:19 -03:00
parent ee2d618285
commit 3d595039cc
10 changed files with 34 additions and 19 deletions

View File

@@ -23,6 +23,15 @@ func CreateUnsignedAuthEvent(challenge string, pubkey nostr.PubKey, relayURL str
}
}
func GetRelayURLFromAuthEvent(event nostr.Event) string {
for _, tag := range event.Tags {
if len(tag) >= 2 && tag[0] == "relay" {
return tag[1]
}
}
return ""
}
// helper function for ValidateAuthEvent.
func parseURL(input string) (*url.URL, error) {
return url.Parse(