<?php
require_once __DIR__ . '/../config/env.php';
require_once __DIR__ . '/../controllers/AuthController.php';

$auth = new AuthController();

// Redirect if already logged in
if ($auth->isLoggedIn()) {
    header('Location: /dashboard');
    exit;
} else {
    // Redirect to login page by default
    header('Location: /login');
    exit;
}
