Code Duplication    Length = 13-17 lines in 2 locations

src/Controller/Adminhtml/Adminlogin/Verify.php 1 location

@@ 97-109 (lines=13) @@
94
     * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
95
     * @throws \Magento\Framework\Exception\NotFoundException
96
     */
97
    public function execute()
98
    {
99
        $secret    = $this->getRequest()->getParam('secret');
100
        $adminUser = $this->adminUser->getAdminUser();
101
102
        $verificationPassed = $this->verifySecret($adminUser, $secret);
103
104
        if ($verificationPassed === false) {
105
            return $this->handleError();
106
        }
107
108
        return $this->handleSuccess();
109
    }
110
111
    private function verifySecret($adminUser, $postedSecret)
112
    {

src/Controller/Customerlogin/Verify.php 1 location

@@ 99-115 (lines=17) @@
96
     * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
97
     * @throws \Magento\Framework\Exception\NotFoundException
98
     */
99
    public function execute()
100
    {
101
        $secret   = $this->getRequest()->getParam('secret');
102
        $customer = $this->customerGetter->getCustomer();
103
104
        if ($customer === false) {
105
            return $this->handleMissingCustomer();
106
        }
107
108
        $verificationPassed = $this->verifySecret($customer, $secret);
109
110
        if ($verificationPassed === false) {
111
            return $this->handleError();
112
        }
113
114
        return $this->handleSuccess();
115
    }
116
117
    private function verifySecret(CustomerInterface $customer, $postedSecret)
118
    {