Commit f2de599f authored by Taddeus Kroes's avatar Taddeus Kroes

Registration page now redirects when logged in

parent 762e46ff
......@@ -23,9 +23,7 @@ function login_form() {
}
$app->get('/login', function () use ($app, $user) {
if ($user->isLoggedIn())
$app->redirect(ROOT_URL);
$user->isLoggedIn() && $app->redirect(ROOT_URL);
$app->render('login', array('form' => login_form()));
});
......
......@@ -37,6 +37,7 @@ function registration_form() {
}
$app->get('/register', function () use ($app, $user) {
$user->isLoggedIn() && $app->redirect(ROOT_URL);
$form = registration_form();
$app->render('register', compact('form'));
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment