fix: nostr auth

This commit is contained in:
Amarpreet Minhas 2024-08-15 19:38:40 -04:00
parent 2fdd3da9d0
commit 1100ea80b6

View file

@ -134,7 +134,7 @@ func NewRelay(version string) *khatru.Relay {
relay.DeleteEvent = append(relay.DeleteEvent, RelayDb.DeleteEvent)
// apply policies
policies.ApplySaneDefaults(relay)
//policies.ApplySaneDefaults(relay)
relay.RejectEvent = append(
relay.RejectEvent,
@ -152,11 +152,6 @@ func NewRelay(version string) *khatru.Relay {
func RejectUnregisteredNpubs(ctx context.Context, event *nostr.Event) (reject bool, msg string) {
l := gologger.Get(config.GetConfig().LogLevel).With().Str("context", "nostr-reject-unregistered").Logger()
authenticatedUser := khatru.GetAuthed(ctx)
if authenticatedUser == "" {
return true, fmt.Sprintf("auth-required: user (%s) not authed", event.PubKey)
}
// reject nip-04 messages to users who aren't registered
if event.Kind == 4 {