<?php
require_once '../config.php';
require_once '../../includes/Auth.php';

$auth = new Auth();

if ($auth->isLoggedIn()) {
    jsonResponse([
        'success' => true,
        'user' => $auth->getUser()
    ]);
} else {
    jsonResponse([
        'success' => false,
        'message' => 'Not authenticated'
    ], 401);
}
?>