<?php
// app/config/session_check.php

//  use model\util\AuthHelper → use app\cnx\professeur\AuthHelper
use app\cnx\professeur\AuthHelper;
use app\cnx\professeur\SessionManager;


require_once __DIR__ . '/../cnx/professeur/SessionManager.php';
require_once __DIR__ . '/../cnx/professeur/AuthHelper.php';

// Start/verify session and require login
AuthHelper::requireLogin();

// Get current user data (optional)
$currentUser = AuthHelper::getCurrentUser();

// Optional: Check if user has specific role
// AuthHelper::requireRole('professeur');

// Generate CSRF token for forms
$csrfToken = SessionManager::getInstance()->generateCsrfToken();

// Get flash message if exists
$flashMessage = SessionManager::getInstance()->getFlashMessage();
?>