private function validateAuthentication()
    {
        if ($this->AppAuth->user()) {
            $this->Customer = TableRegistry::getTableLocator()->get('Customers');
            $query = $this->Customer->find('all', [
                'conditions' => [
                    'Customers.email' => $this->AppAuth->getEmail()
                ]
            ]);
            $query = $this->Customer->findAuth($query, []);
            if (empty($query->first())) {
                $this->Flash->error(__('You_have_been_signed_out.'));
                $this->AppAuth->logout();
                $this->redirect(Configure::read('app.slugHelper')->getHome());
            }
        }
    }
private function validateAuthentication()
    {
        if ($this->AppAuth->user()) {
            $this->Customer = TableRegistry::getTableLocator()->get('Customers');
            $query = $this->Customer->find('all', [
                'conditions' => [
                    'Customers.email' => $this->AppAuth->getEmail()
                ]
            ]);
            $query = $this->Customer->findAuth($query, []);
            if (empty($query->first())) {
                $this->Flash->error(__('You_have_been_signed_out.'));
                $this->AppAuth->logout();
                $this->redirect(Configure::read('app.slugHelper')->getHome());
            }
        }
    }
private function validateAuthentication ( ) { if ( $ this -> AppAuth -> user ( ) ) { $ this -> Customer = TableRegistry :: getTableLocator ( ) -> get ( 'Customers' ) ; $ query = $ this -> Customer -> find ( 'all' , [ 'conditions' => [ 'Customers.email' => $ this -> AppAuth -> getEmail ( ) ] ] ) ; $ query = $ this -> Customer -> findAuth ( $ query , [ ] ) ; if ( empty ( $ query -> first ( ) ) ) { $ this -> Flash -> error ( __ ( 'You_have_been_signed_out.' ) ) ; $ this -> AppAuth -> logout ( ) ; $ this -> redirect ( Configure :: read ( 'app.slugHelper' ) -> getHome ( ) ) ; } } }
check valid login on each request
logged in user should be logged out if deleted or deactivated by admin
check valid login on each request logged in user should be logged out if deleted or deactivated by admin