summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca <Luca@hackerspace-bamberg.de>2019-06-13 15:18:47 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2019-06-14 04:15:20 +0200
commit9232513831501e8a0cb4f14299cd8f85afe7bc7f (patch)
tree4df0b09bbd4b3448db12b98b7c55e3e6d0a2a0c1
parent6ed891fc0416e8025f929cf60a07b1020118b221 (diff)
Fix caching issue for '/' route
-rw-r--r--config/routes.php5
-rw-r--r--src/Controllers/HomeController.php16
2 files changed, 17 insertions, 4 deletions
diff --git a/config/routes.php b/config/routes.php
index 6cc0ce8b..e999d026 100644
--- a/config/routes.php
+++ b/config/routes.php
@@ -1,14 +1,11 @@
<?php
-use Engelsystem\Http\Exceptions\HttpTemporaryRedirect;
use FastRoute\RouteCollector;
/** @var RouteCollector $route */
// Pages
-$route->get('/', function () {
- throw new HttpTemporaryRedirect(auth()->user() ? config('home_site') : 'login');
-});
+$route->get('/', 'HomeController@index');
$route->get('/credits', 'CreditsController@index');
// Authentication
diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php
new file mode 100644
index 00000000..809593ce
--- /dev/null
+++ b/src/Controllers/HomeController.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace Engelsystem\Controllers;
+
+use Engelsystem\Http\Exceptions\HttpTemporaryRedirect;
+
+class HomeController extends BaseController
+{
+ /**
+ * @throws HttpTemporaryRedirect
+ */
+ public function index()
+ {
+ throw new HttpTemporaryRedirect(auth()->user() ? config('home_site') : 'login');
+ }
+}