public function authorize() { // Prevent the user from having access to protected content foreach ($this->excludedRoutes as $excludedRoute) { if (preg_match_all("/{$excludedRoute}/i", Router::getRoute()) > 0) { return; } } if (!Session::get("logged_in")) { Redirect::path($this->signinRoute ? $this->signinRoute : Url::action('signin')); } }
public function getProfile() { if (Session::get('logged_in')) { return Session::get('user'); } else { $this->redirectToLogin(); } }