<?php

namespace App\Controllers;

use App\Modules\Auth\Services\AuthService;
use CodeIgniter\HTTP\ResponseInterface;

/**
 * Web Logout: clears session and redirects to login.
 */
class LogoutController extends BaseController
{
    public function index(): ResponseInterface
    {
        (new AuthService())->logout();
        return redirect()->to('/login');
    }
}
