mirror of
https://github.com/fiatjaf/nak.git
synced 2026-06-04 09:41:24 +02:00
count: use Pool.AuthRequiredHandler to match other commands.
This commit is contained in:
6
count.go
6
count.go
@@ -44,17 +44,17 @@ var count = &cli.Command{
|
||||
forcePreAuthSigner = nil
|
||||
}
|
||||
|
||||
sys.Pool.RelayOptions.AuthHandler = func(ctx context.Context, _ *nostr.Relay, aevt *nostr.Event) error {
|
||||
sys.Pool.AuthRequiredHandler = func(ctx context.Context, authEvent *nostr.Event) error {
|
||||
return authSigner(ctx, c, func(s string, args ...any) {
|
||||
if strings.HasPrefix(s, "authenticating as") {
|
||||
cleanUrl, _ := strings.CutPrefix(
|
||||
nip42.GetRelayURLFromAuthEvent(*aevt),
|
||||
nip42.GetRelayURLFromAuthEvent(*authEvent),
|
||||
"wss://",
|
||||
)
|
||||
s = "authenticating to " + color.CyanString(cleanUrl) + " as" + s[len("authenticating as"):]
|
||||
}
|
||||
log(s+"\n", args...)
|
||||
}, aevt)
|
||||
}, authEvent)
|
||||
}
|
||||
relays := connectToAllRelays(
|
||||
ctx,
|
||||
|
||||
Reference in New Issue
Block a user