aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/homepage.php
diff options
context:
space:
mode:
Diffstat (limited to 'routes/homepage.php')
-rw-r--r--routes/homepage.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/routes/homepage.php b/routes/homepage.php
index db8ea72..c99dce4 100644
--- a/routes/homepage.php
+++ b/routes/homepage.php
@@ -2,12 +2,17 @@
use Digitigrade\HttpResponseStatus\NotFound;
use Digitigrade\HttpResponseStatus\TemporaryRedirect;
+use Digitigrade\Model\UserAccount;
use Digitigrade\Router;
Router::getInstance()->mount('/', function (array $args) {
$accept = $_SERVER['HTTP_ACCEPT'] ?? '';
if (str_contains($accept, 'text/html') || str_contains($accept, '*/*')) {
- throw new TemporaryRedirect('/feed/global');
+ throw new TemporaryRedirect(
+ UserAccount::findByCurrentSession() == null
+ ? '/feed/global'
+ : '/feed/home'
+ );
}
throw new NotFound();
}); \ No newline at end of file