Skip to content

Commit 9473c19

Browse files
Guido Gröönmrts
authored andcommitted
WE2-689 Updated example
1 parent a5e9861 commit 9473c19

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

examples/src/Pages.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ public function login()
1717

1818
public function welcome()
1919
{
20-
if (!isset($_SESSION["auth-user"])) {
21-
// Redirect to login
22-
header("location:/");
23-
return;
24-
}
25-
2620
$data = [];
2721
$data["auth_user"] = $_SESSION["auth-user"];
2822
$this->data['content'] = $this->template->getHtml(__DIR__ . '/../tpl/welcome.phtml', $data);

examples/src/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function init()
1414
$router->map('GET', '/', ['controller' => 'Pages', 'method' => 'login']);
1515
$router->map('GET', '/logout', ['controller' => 'Auth', 'method' => 'logout']);
1616

17-
// Allow route onlu for authenticated users
17+
// Allow route only for authenticated users
1818
if (isset($_SESSION["auth-user"])) {
1919
$router->map('GET', '/welcome', ['controller' => 'Pages', 'method' => 'welcome']);
2020
}

0 commit comments

Comments
 (0)