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

$next = trim((string)($_GET['next'] ?? 'index.php'));
$allowedNext = [
	'index.php',
	'tuckshop_projects_login.php',
	'produce_desktop.php',
	'tuckshop_desktop.php'
];
if (!in_array($next, $allowedNext, true)) {
	$next = 'index.php';
}

logout_user();
header('Location: ' . $next);
exit;
