mirror of
https://github.com/fiatjaf/nak.git
synced 2026-02-03 23:46:12 +00:00
prevent panic on AUTH challenge tag (nil or len<2)
This commit is contained in:
committed by
fiatjaf_
parent
ba9a5badc6
commit
b5de7b78bc
@@ -261,7 +261,7 @@ func connectToSingleRelay(
|
||||
for range 5 {
|
||||
if err := relay.Auth(ctx, func(ctx context.Context, authEvent *nostr.Event) error {
|
||||
challengeTag := authEvent.Tags.Find("challenge")
|
||||
if challengeTag[1] == "" {
|
||||
if challengeTag == nil || len(challengeTag) < 2 || challengeTag[1] == "" {
|
||||
return fmt.Errorf("auth not received yet *****") // what a giant hack
|
||||
}
|
||||
return preAuthSigner(ctx, c, logthis, authEvent)
|
||||
|
||||
Reference in New Issue
Block a user