fix: encode certificate ID in QR code URL

- 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 <noreply@anthropic.com>
This commit is contained in:
Maulana Sodiqin
2025-12-10 21:23:35 +07:00
co-authored by Claude
parent 0267de664b
commit c518784810
@@ -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,