FIX: Auth missing from some routes

This commit is contained in:
Juan Pablo Vial
2024-03-20 20:43:53 -03:00
parent 7cc0333876
commit e50d80560c
2 changed files with 7 additions and 1 deletions

View File

@ -1,2 +1,2 @@
<?php <?php
//$app->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class)); $app->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));

View File

@ -46,10 +46,16 @@ class Authentication
$valid_paths = [ $valid_paths = [
'/', '/',
'/api'
]; ];
if (in_array($current_path, $valid_paths, true)) { if (in_array($current_path, $valid_paths, true)) {
return true; return true;
} }
foreach ($valid_paths as $path) {
if (str_starts_with($current_path, $path)) {
return true;
}
}
$valid_uris = [ $valid_uris = [
$this->login_url, $this->login_url,
]; ];