<?php

/**
 * Logout - Destroy session and redirect to login
 */

declare(strict_types=1);

// Load config and auth
$configPath = __DIR__ . '/config.php';
if (!file_exists($configPath)) {
    die('Configuration file not found');
}
$config = require $configPath;

require_once __DIR__ . '/src/auth.php';

$auth = new \Notifier\Auth($config);
$auth->logout();

// Redirect to login page
header('Location: /notifier/login/');
exit;
