Require token for wash certificate downloads

This commit is contained in:
Jeppe B
2026-06-01 22:57:23 +02:00
parent 4945abfd8e
commit 06421beb6b
@@ -20,7 +20,11 @@ if (!is_numeric($certificate_id) || $certificate_id < 1) {
return;
}
// TODO: Add authentication here
// Require a valid static token before serving certificates
if (!isset($_GET['secret_token']) || $_GET['secret_token'] !== $WORDPRESS_STATIC_TOKEN) {
header('HTTP/1.0 401 Unauthorized');
return;
}
// Check if the certificate exists in the /output/certificates folder
if (!file_exists("../output/certificates/wash_certificate_" . $certificate_id . ".pdf")) {