From 1f0001476551fa2e8734e5a5ec7e4a570636242d Mon Sep 17 00:00:00 2001 From: benthecarman Date: Wed, 3 Apr 2024 17:56:29 -0500 Subject: [PATCH] Fix zap verification --- src/lnurlp.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lnurlp.rs b/src/lnurlp.rs index 4277ce8..94fd23f 100644 --- a/src/lnurlp.rs +++ b/src/lnurlp.rs @@ -73,11 +73,12 @@ pub async fn lnurl_callback( )); } - // verify nostr param is a zap request - if params - .nostr - .as_ref() - .is_some_and(|n| Event::from_json(n).is_ok_and(|e| e.kind == Kind::ZapRequest)) + // verify nostr param is a zap request if we have one + if params.nostr.is_some() + && !params + .nostr + .as_ref() + .is_some_and(|n| Event::from_json(n).is_ok_and(|e| e.kind == Kind::ZapRequest)) { return Err(anyhow::anyhow!("Invalid nostr event")); }