Skip to content

Commit

Permalink
validate amount, but not description hash
Browse files Browse the repository at this point in the history
description hash validation is being removed from the spec lnurl/luds#234
  • Loading branch information
SamSamskies committed Nov 30, 2023
1 parent fba7468 commit 7292edc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/[lnUrlOrAddress]/[amount].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import type { Satoshis } from "lnurl-pay/dist/types/types";

export const getServerSideProps: GetServerSideProps = async ({ query }) => {
try {
const { invoice } = await requestInvoice({
const { invoice, hasValidAmount } = await requestInvoice({
lnUrlOrAddress: query.lnUrlOrAddress as string,
tokens: Number(query.amount) as Satoshis,
comment: query.comment as string,
validateInvoice: true,
});

if (!hasValidAmount) {
return { props: { error: "Something went wrong with generating the invoice." } };
}

return {
props: {
invoice,
Expand Down

0 comments on commit 7292edc

Please sign in to comment.