From c518784810a76744f9073a015ac5e4d1c6246c15 Mon Sep 17 00:00:00 2001 From: Maulana Sodiqin Date: Wed, 10 Dec 2025 21:23:20 +0700 Subject: [PATCH] fix: encode certificate ID in QR code URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use encodeURIComponent to properly encode certId - Fixes QR code URLs with special characters like /, +, = - QR codes now generate with properly encoded URLs (%2F, %2B, %3D) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- apps/hackathon/src/app/certificate/[certId]/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/hackathon/src/app/certificate/[certId]/page.tsx b/apps/hackathon/src/app/certificate/[certId]/page.tsx index 39ceab8..de0e5ac 100644 --- a/apps/hackathon/src/app/certificate/[certId]/page.tsx +++ b/apps/hackathon/src/app/certificate/[certId]/page.tsx @@ -44,7 +44,9 @@ const CertificatePage: FC = (): ReactElement => { // Generate QR Code useEffect(() => { if (certId) { - const certificateUrl = `${window.location.origin}/certificate/${certId}`; + // Use encodeURIComponent to properly encode the certId for the URL + const encodedCertId = encodeURIComponent(certId); + const certificateUrl = `${window.location.origin}/certificate/${encodedCertId}`; QRCode.toDataURL(certificateUrl, { width: 200, margin: 1,