Code Duplication    Length = 3-3 lines in 2 locations

src/controllers/TotpController.php 2 locations

@@ 198-200 (lines=3) @@
195
            return ['_error' => 'mfa already enabled' . $secret];
196
        }
197
198
        if (!$this->module->getTotp()->verifyCode($identity->getTemporarySecret(), $this->request->post('code', ''))) {
199
            return ['_error' => 'invalid totp code'];
200
        }
201
202
        $identity->setTotpSecret($identity->getTemporarySecret());
203
        $identity->setTemporarySecret(null);
@@ 218-220 (lines=3) @@
215
            return ['_error' => 'mfa disabled, enable first'];
216
        }
217
218
        if (!$this->module->getTotp()->verifyCode($secret, $this->request->post('code', ''))) {
219
            return ['_error' => 'invalid totp code'];
220
        }
221
222
        $identity->setTotpSecret('');
223
        $identity->save();