protected function checkAuthentication(Request $request)
    {
        if (!$request->hasPreviousSession()) {
            return;
        }

        $session = $request->getSession();

        if ($session->has('token')) {
            $token = $session->get('token');
            $this->tokenStorage->setToken($token);
        }
    }
protected function checkAuthentication(Request $request)
    {
        if (!$request->hasPreviousSession()) {
            return;
        }

        $session = $request->getSession();

        if ($session->has('token')) {
            $token = $session->get('token');
            $this->tokenStorage->setToken($token);
        }
    }
protected function checkAuthentication ( Request $ request ) { if ( ! $ request -> hasPreviousSession ( ) ) { return ; } $ session = $ request -> getSession ( ) ; if ( $ session -> has ( 'token' ) ) { $ token = $ session -> get ( 'token' ) ; $ this -> tokenStorage -> setToken ( $ token ) ; } }
Checks if a Wordpress user is authenticated and authenticate him into Symfony security context.

@param Request $request
Checks if a Wordpress user is authenticated and authenticate him into Symfony security context .