<?php
// api/auth_check.php – sessiya tirikmi-yo'qmi tekshirish uchun
declare(strict_types=1);

header('Content-Type: application/json; charset=utf-8');

require_once __DIR__ . '/auth_stub.php';

if (!is_logged_in()) {
    http_response_code(401);
    echo json_encode([
        'status'  => 'error',
        'message' => 'not_authenticated',
    ], JSON_UNESCAPED_UNICODE);
    exit;
}

echo json_encode([
    'status'  => 'ok',
    'message' => 'authenticated',
], JSON_UNESCAPED_UNICODE);
