/*
|--------------------------------------------------------------------------
| 1) ORIGINAL CODE (COMMENTED OUT)
|--------------------------------------------------------------------------
|
| 100% of the current existing routes file, fully commented out so you can
| easily re-enable it if you want the session filter again in the future.
|
*/

/*
$routes->get('/', 'Home::index', ['filter' => 'session']);
$routes->add('/user/', 'User::index');
$routes->add('/user/(:any)', 'User::$1');
$routes->add('/(:any)', 'Home::$1');

service('auth')->routes($routes);

// Add Shield routes with an array configuration
$authConfig = [];
service('auth')->routes($routes, $authConfig);

// GPT Connection routes
$routes->get('/category/gpt_connection', 'Gpt_connection::index', ['filter' => 'session']); // Route for Gpt_connection category
$routes->get('/gpt', 'Gpt_connection::index', ['filter' => 'session']); // Route for /gpt pointing to the same controller
$routes->post('/gpt_connection/submit', 'Gpt_connection::submit', ['filter' => 'session']); // Route to handle GPT form submission

// Session route
$routes->get('/session', 'Session::index', ['filter' => 'session']);

// Authentication routes (for auth library)
service('auth')->routes($routes);

// Routes for Works and Chapters (should be above wildcard routes)
$routes->get('work/(:num)', 'Home::work/$1', ['filter' => 'session']); // Route to view a specific work
$routes->get('work/(:num)/chapter/(:num)', 'Home::chapter/$1/$2', ['filter' => 'session']); // Route to view a specific chapter in a work

// Wildcard route for Home methods (placed last to avoid conflicts)
$routes->add('/(:any)', 'Home::$1', ['filter' => 'session']);

// Additional routes
$routes->get('/', 'Home::index', ['filter' => 'session']);
$routes->get('home/changeLanguage/(:any)', 'Home::changeLanguage/$1', ['filter' => 'session']);
$routes->get('home/work/(:num)/(:num)', 'Home::work/$1/$2', ['filter' => 'session']);
$routes->get('home/work/(:num)', 'Home::work/$1', ['filter' => 'session']);
$routes->get('home/downloadPdf/(:num)/(:segment)', 'Home::downloadPdf/$1/$2', ['filter' => 'session']);
$routes->get('session', 'Session::index');

$routes->get('home/playAudio/(:num)', 'Home::playAudio/$1');
$routes->get('home/playAudioFromChapter/(:num)/(:num)', 'Home::playAudioFromChapter/$1/$2');
*/

/*
|--------------------------------------------------------------------------
| 2) NEW VERSION (NO SESSION FILTER - ALL PUBLIC)
|--------------------------------------------------------------------------
|
| The same routes, but without any "session" filter so all pages are public.
| Uncomment these lines (and keep the original commented) if you want everything
| to be accessible without login.
|
*/