update go-nostr keyer interface and make req --auth work again.

This commit is contained in:
fiatjaf
2024-09-22 19:21:41 -03:00
parent 43fe41df5d
commit d7c0ff2bb7
7 changed files with 22 additions and 14 deletions

6
req.go
View File

@@ -76,7 +76,7 @@ example:
relayUrls,
c.Bool("force-pre-auth"),
nostr.WithAuthHandler(
func(authEvent *nostr.Event) error {
func(ctx context.Context, authEvent nostr.RelayEvent) error {
if !c.Bool("auth") && !c.Bool("force-pre-auth") {
return fmt.Errorf("auth not authorized")
}
@@ -85,10 +85,10 @@ example:
return err
}
pk := kr.GetPublicKey(ctx)
pk, _ := kr.GetPublicKey(ctx)
log("performing auth as %s... ", pk)
return kr.SignEvent(ctx, authEvent)
return kr.SignEvent(ctx, authEvent.Event)
},
),
)