Added: favicon, Dashboard, Habits list, some styles, dashboard redirect

This commit is contained in:
2024-12-27 02:06:32 +01:00
parent d33d233f0f
commit 2847231376
17 changed files with 266 additions and 45 deletions

View File

@ -24,8 +24,11 @@ require_once models . 'Habit.php';
// Initialize router
$router = new Router();
$router->add('/', 'HomeController@index');
$router->add('/home', 'HomeController@home');
if(!$_SESSION['user']) {
$router->add('/', 'HomeController@index');
} else {
$router->add('/', 'DashboardController@reroute', ['RequireAuth']);
}
// auth routes
$router->group('/auth', [], function ($router) {
@ -35,7 +38,7 @@ $router->group('/auth', [], function ($router) {
});
// dashboard route
$router->add('/dashboard', 'HomeController@dashboard', ['RequireAuth']);
$router->add('/dashboard', 'DashboardController@index', ['RequireAuth']);
// habits routes
$router->group('/habits', ['RequireAuth'], function ($router) {