request auth when rejecting because of no auth

This commit is contained in:
Amarpreet Minhas 2024-09-23 22:18:05 -04:00
parent 250680a989
commit 84ba15babe

View file

@ -28,6 +28,7 @@ func RejectUnregisteredNpubs(ctx context.Context, event *nostr.Event) (reject bo
authenticatedUser := khatru.GetAuthed(ctx)
if authenticatedUser == "" {
l.Debug().Msgf("kind: %v, pubkey not authed: %s", event.Kind, event.PubKey)
khatru.RequestAuth(ctx)
return true, fmt.Sprintf("auth-required: interacting with this relay requires authentication")
}