Improve tracking UX, archive editing, branding, and proxy-safe auth flow

This commit is contained in:
2026-04-11 19:21:07 +02:00
parent 87f7859017
commit 4b95cc3dcb
2 changed files with 20 additions and 6 deletions
+13 -5
View File
@@ -27,16 +27,24 @@ final class App
$path = request_path();
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
$hasUsers = $this->users->hasAnyUsers();
$isAuthenticated = $this->auth->check();
if (!$this->users->hasAnyUsers()) {
if ($path !== '/setup') {
if (!$hasUsers) {
if ($path === '/login') {
$path = '/setup';
} elseif ($path !== '/setup') {
redirect('/setup');
}
} elseif (!$this->auth->check() && $path !== '/login') {
redirect('/login');
} elseif (!$isAuthenticated) {
if ($path === '/setup') {
$path = '/login';
} elseif ($path !== '/login') {
redirect('/login');
}
}
if ($this->auth->check() && in_array($path, ['/login', '/setup'], true)) {
if ($isAuthenticated && in_array($path, ['/login', '/setup'], true)) {
redirect('/');
}