public function before(Request $request)
    {
        // Start the 'stopwatch' for the profiler.
        $this->app['stopwatch']->start('bolt.async.before');

        // If there's no active session, don't do anything.
        $authCookie = $request->cookies->get($this->app['token.authentication.name']);
        if ($authCookie === null || !$this->accessControl()->isValidSession($authCookie)) {
            $this->abort(Response::HTTP_UNAUTHORIZED, 'You must be logged in to use this.');
        }

        // Stop the 'stopwatch' for the profiler.
        $this->app['stopwatch']->stop('bolt.async.before');
    }
public function before(Request $request)
    {
        // Start the 'stopwatch' for the profiler.
        $this->app['stopwatch']->start('bolt.async.before');

        // If there's no active session, don't do anything.
        $authCookie = $request->cookies->get($this->app['token.authentication.name']);
        if ($authCookie === null || !$this->accessControl()->isValidSession($authCookie)) {
            $this->abort(Response::HTTP_UNAUTHORIZED, 'You must be logged in to use this.');
        }

        // Stop the 'stopwatch' for the profiler.
        $this->app['stopwatch']->stop('bolt.async.before');
    }
public function before ( Request $ request ) { // Start the 'stopwatch' for the profiler. $ this -> app [ 'stopwatch' ] -> start ( 'bolt.async.before' ) ; // If there's no active session, don't do anything. $ authCookie = $ request -> cookies -> get ( $ this -> app [ 'token.authentication.name' ] ) ; if ( $ authCookie === null || ! $ this -> accessControl ( ) -> isValidSession ( $ authCookie ) ) { $ this -> abort ( Response :: HTTP_UNAUTHORIZED , 'You must be logged in to use this.' ) ; } // Stop the 'stopwatch' for the profiler. $ this -> app [ 'stopwatch' ] -> stop ( 'bolt.async.before' ) ; }
Middleware function to do some tasks that should be done for all
asynchronous requests.

@param Request $request
Middleware function to do some tasks that should be done for all asynchronous requests .