fix: use cache-busting 'verify_qr' route to bypass Varnish cache caching old 302 redirects
This commit is contained in:
@@ -11,7 +11,7 @@ $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
$route = $_GET['route'] ?? str_replace('/api/', '', $uri);
|
||||
$route = trim($route, '/');
|
||||
|
||||
if ($route === 'verify' || $route === 'v.php' || $route === 'v1/verify') {
|
||||
if ($route === 'verify_qr' || $route === 'verify' || $route === 'v.php' || $route === 'v1/verify') {
|
||||
$id = $_GET['id'] ?? null;
|
||||
require_once APP_PATH . '/modules_app/invoices/verify_public.php';
|
||||
exit;
|
||||
|
||||
@@ -3039,7 +3039,7 @@
|
||||
getQrSrc(inv) {
|
||||
if (!inv) return '';
|
||||
if (inv.jofotara?.qr_image_uri) return inv.jofotara.qr_image_uri;
|
||||
const verifyUrl = `https://musadaq.intaleqapp.com/index.php?route=verify&id=${inv.id}`;
|
||||
const verifyUrl = `https://musadaq.intaleqapp.com/index.php?route=verify_qr&id=${inv.id}`;
|
||||
const qr = new QRious({ value: verifyUrl, size: 300, level: 'H' });
|
||||
return qr.toDataURL();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user