diff --git a/pages/[lnUrlOrAddress]/[amount].tsx b/pages/[lnUrlOrAddress]/[amount].tsx index 8974dcb..d722c7a 100644 --- a/pages/[lnUrlOrAddress]/[amount].tsx +++ b/pages/[lnUrlOrAddress]/[amount].tsx @@ -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,