<?php
declare(strict_types=1);
require_once __DIR__ . '/../lib.php';

hw_require_method(['GET']);

// Clear auth cookie
setcookie('hw_token', '', [
    'expires' => time() - 3600,
    'path' => hw_config()['app']['base_url'] ?: '/',
    'secure' => (bool)hw_config()['app']['cookie_secure'],
    'httponly' => true,
    'samesite' => 'Lax',
    'domain' => hw_config()['app']['cookie_domain'] ?: '',
]);

// Redirect to sign-in page
header('Location: /files/atasteofafricanmarketplace/login-choice.php');
exit;
