Skip to content

Commit

Permalink
fix possible cross site vul
Browse files Browse the repository at this point in the history
  • Loading branch information
mykcryptodev committed Oct 3, 2024
1 parent 5e202ce commit 4c639c7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export default function Home({ searchParams }: { searchParams: any }) {
setAmount(e.target.value);
};

const goToCheckout = () => {
if (resolvedAddress && amount) {
window.location.href = `/checkout?address=${resolvedAddress}&baseAmount=${amount}`;

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
}
}

const { resolvedAddress: ensResolvedAddress, avatarUrl: ensAvatarUrl, needsProvider } = useEnsResolver(address, provider);

return (
Expand Down Expand Up @@ -96,12 +102,12 @@ export default function Home({ searchParams }: { searchParams: any }) {
onChange={handleAmountChange}
/>
</label>
<Link
href={`/checkout?address=${address}&baseAmount=${amount}`}
<button
onClick={goToCheckout}
className="btn btn-primary btn-lg mt-4"
>
Check out
</Link>
</button>
</div>
</div>
</main>
Expand Down

0 comments on commit 4c639c7

Please sign in to comment.