Rewrite all AIO interface paths to be relative

Signed-off-by: Lorenzo Moscati <lorenzo@moscati.page>
This commit is contained in:
Lorenzo Moscati 2025-08-23 01:30:20 +02:00
parent 4581cf7649
commit 21fbb58c96
No known key found for this signature in database
14 changed files with 96 additions and 79 deletions

View file

@ -27,7 +27,15 @@ readonly class AuthMiddleware {
if(!in_array($request->getUri()->getPath(), $publicRoutes)) {
if(!$this->authManager->IsAuthenticated()) {
$status = 302;
$headers = ['Location' => '/'];
if(count(explode('/', $request->getUri()->getPath())) > 2) {
$location = '..';
for($i = 0; $i < count(explode('/', $request->getUri()->getPath())) - 3; $i++) {
$location = $location . '/..';
}
} else {
$location = '.';
}
$headers = ['Location' => $location];
$response = new Response($status, $headers);
return $response;
}