pageFactory = $pageFactory; $this->session = $session; $this->tfa = $tfa; } /** * Get current user * @return \Magento\User\Model\User|null */ private function getUser() { return $this->session->getUser(); } /** * @inheritdoc */ public function execute() { return $this->pageFactory->create(); } /** * @inheritdoc */ protected function _isAllowed() { $user = $this->getUser(); return $user && $this->tfa->getProviderIsAllowed($user->getId(), Authy::CODE) && !$this->tfa->getProvider(Authy::CODE)->isActive($user->getId()); } }