Open mhulse opened 7 years ago
public function check() {
return isset($_SESSION['user']);
}
Need to do this for all, like:
# Quick patch to avoid NOTICE:
if (isset($_SESSION['errors'])) {
$this->container->view->getEnvironment()->addGlobal('errors', $_SESSION['errors']); // Now a global inside of views.
unset($_SESSION['errors']); // This is important!
}
Make utility class for this kind of thing.
return $this->check() ? User::find($_SESSION['user']) : '';
https://github.com/mhulse/slim-php-boiler/blob/d404dff8d1870d37e85e632c627a05e1d924aa7b/app/Auth/Auth.php#L12