<?php

declare(strict_types=1);

require_once __DIR__ . '/../includes/api_service.php';

$token = trim($_GET['token'] ?? '');

if ($token === '') {
    http_response_code(404);
    exit('Not found');
}

header('Location: ' . contract_public_pdf_url(['token' => $token, 'sign_token' => $token]), true, 302);
exit;
