Skip to content

Commit

Permalink
Merge pull request #14 from MutinyWallet/fix-zap-verification
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored Apr 3, 2024
2 parents d501de3 + 1f00014 commit 9eb8e46
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/lnurlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down

0 comments on commit 9eb8e46

Please sign in to comment.