more kinds

This commit is contained in:
Amarpreet Minhas 2024-08-31 09:49:47 -04:00
parent f559af7f27
commit 37cbe6c624

View file

@ -14,15 +14,15 @@ func RejectUnregisteredNpubs(ctx context.Context, event *nostr.Event) (reject bo
var err error
l := gologger.Get(config.GetConfig().LogLevel).With().Str("context", "nostr-reject-unregistered").Logger()
// always allow auth messages and seals
if event.Kind == 22242 || event.Kind == 13 {
// always allow seals, lightning ephemeral messages, auth messages
if event.Kind == 13 || event.Kind == 21000 || event.Kind == 22242 || event.Kind == 30078 {
return false, ""
}
// ensure pubkey has authenticated
authenticatedUser := khatru.GetAuthed(ctx)
if authenticatedUser == "" {
l.Debug().Msgf("pubkey not authed: %s", event.PubKey)
l.Debug().Msgf("kind: %v, pubkey not authed: %s", event.Kind, event.PubKey)
return true, fmt.Sprintf("auth-required: interacting with this relay requires authentication")
}