<?php
require_once __DIR__ . '/../config.php';

if (empty($_SESSION['user_id'])) {
    respond(['authenticated' => false], 200);
}

respond([
    'authenticated' => true,
    'id' => $_SESSION['user_id'],
    'username' => $_SESSION['username'],
    'name' => $_SESSION['name'],
    'role' => $_SESSION['role'],
]);
