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:
co-authored by
Claude
parent
0267de664b
commit
c518784810
@@ -44,7 +44,9 @@ const CertificatePage: FC = (): ReactElement => {
|
|||||||
// Generate QR Code
|
// Generate QR Code
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (certId) {
|
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, {
|
QRCode.toDataURL(certificateUrl, {
|
||||||
width: 200,
|
width: 200,
|
||||||
margin: 1,
|
margin: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user