src/User/Component/Authentication/User.php
public static function checkAuthentication($redirect = true)
    {
        if(static::isAuthenticated()) {
            return;
        }

        if ($redirect) {
            Http\Server::getInstance()->redirect(RouteCollection::getInstance()->get('login')->getUri());
        } else {
            throw new LoginException();
        }
    }
public static function checkAuthentication($redirect = true)
    {
        if(static::isAuthenticated()) {
            return;
        }

        if ($redirect) {
            Http\Server::getInstance()->redirect(RouteCollection::getInstance()->get('login')->getUri());
        } else {
            throw new LoginException();
        }
    }
public static function checkAuthentication ( $ redirect = true ) { if ( static :: isAuthenticated ( ) ) { return ; } if ( $ redirect ) { Http \ Server :: getInstance ( ) -> redirect ( RouteCollection :: getInstance ( ) -> get ( 'login' ) -> getUri ( ) ) ; } else { throw new LoginException ( ) ; } }
Check for authentication & redirect if not logged in.

@param  bool $redirect
@return void
@throws \Exception
Check for authentication & redirect if not logged in .