' * } * * */ require_once BASE_PATH . 'server/includes/core/class.response.php'; require_once BASE_PATH . 'server/includes/core/class.webappauthentication.php'; // This request only works with GET if ($_SERVER['REQUEST_METHOD'] !== 'GET') { Response::wrongMethod(); } // We will always respond with status 200 for this request. // The response will tell the requester if he is authenticated // or not. echo json_encode([ 'authenticated' => WebAppAuthentication::isAuthenticated(), 'username' => WebAppAuthentication::getUserName(), ]); exit;