mirror of
https://github.com/fiatjaf/nak.git
synced 2025-08-27 20:50:47 -04:00
tags GetFirst() => Find()
This commit is contained in:
@@ -176,8 +176,8 @@ relayLoop:
|
||||
// beginhack
|
||||
// here starts the biggest and ugliest hack of this codebase
|
||||
if err := relay.Auth(ctx, func(authEvent *nostr.Event) error {
|
||||
challengeTag := authEvent.Tags.GetFirst([]string{"challenge", ""})
|
||||
if (*challengeTag)[1] == "" {
|
||||
challengeTag := authEvent.Tags.Find("challenge")
|
||||
if challengeTag[1] == "" {
|
||||
return fmt.Errorf("auth not received yet *****")
|
||||
}
|
||||
return signer(ctx, nostr.RelayEvent{Event: authEvent, Relay: relay})
|
||||
|
2
req.go
2
req.go
@@ -84,7 +84,7 @@ example:
|
||||
defer func() {
|
||||
if err != nil {
|
||||
log("auth to %s failed: %s\n",
|
||||
(*authEvent.Tags.GetFirst([]string{"relay", ""}))[1],
|
||||
authEvent.Tags.Find("relay")[1],
|
||||
err,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user