public function checkLogin() { $crud = $this; Auth::checkLogin(function () use($crud) { // Get request object $req = $crud->getSlim()->request; //Get root URI $rootUri = $req->getRootUri(); //Get resource URI $resourceUri = $req->getResourceUri(); $_SESSION["redirect"] = $resourceUri; header("Location: " . Util::fullURL("auth/login")); die; }); }
public static function checkLogin($callback) { if (!Auth::isLoggedIn()) { $callback(); } }