<?php

require __DIR__ . '/common.php';
use Ministra\Lib\Itv;
if (empty($_GET['token'])) {
    \header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
    exit;
}
$uid = \Ministra\Lib\Itv::checkTemporaryLink($_GET['token']);
if (!$uid) {
    \header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
} else {
    \header('X-AuthDuration: 36000');
    \header('X-Unique: true');
    \header('X-Max-Sessions: ' . \Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\K131970f0a776522b1a53ba419cd5e32c::getSafe('max_local_recordings', 10));
    \header('X-UserId: ' . $uid);
    \header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
}
