Skip to content
Snippets Groups Projects
Commit f2de599f authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

Registration page now redirects when logged in

parent 762e46ff
No related branches found
No related tags found
No related merge requests found
......@@ -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'));
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment