<?php
declare(strict_types=1);

require_once __DIR__ . '/response.php';
require_once __DIR__ . '/auth.php';

function requireAuth(): void
{
    if (!getAuthenticatedUser()) {
        jsonResponse([
            'error' => 'Unauthorized',
            'code'  => 'AUTH_REQUIRED'
        ], 401);
    }
}
