public function onStorageEventPostSave(StorageEvent $event)
    {
        /** @var Entity\Users $userEntity */
        $userEntity = $event->getContent();
        if (!$userEntity instanceof Entity\Users) {
            return;
        }

        if (!$userEntity->isEnabled()) {
            $this->deleteAuthtokens($userEntity);
            $this->deleteSessions($userEntity);
        }
    }
public function onStorageEventPostSave(StorageEvent $event)
    {
        /** @var Entity\Users $userEntity */
        $userEntity = $event->getContent();
        if (!$userEntity instanceof Entity\Users) {
            return;
        }

        if (!$userEntity->isEnabled()) {
            $this->deleteAuthtokens($userEntity);
            $this->deleteSessions($userEntity);
        }
    }
public function onStorageEventPostSave ( StorageEvent $ event ) { /** @var Entity\Users $userEntity */ $ userEntity = $ event -> getContent ( ) ; if ( ! $ userEntity instanceof Entity \ Users ) { return ; } if ( ! $ userEntity -> isEnabled ( ) ) { $ this -> deleteAuthtokens ( $ userEntity ) ; $ this -> deleteSessions ( $ userEntity ) ; } }
Remove sessions & authtokens when a user is disabled.

@param StorageEvent $event
Remove sessions & authtokens when a user is disabled .