Code Duplication    Length = 3-3 lines in 2 locations

src/controllers/TotpController.php 2 locations

@@ 201-203 (lines=3) @@
198
            return ['_error' => 'mfa already enabled' . $secret];
199
        }
200
201
        if (!$this->module->getTotp()->verifyCode($identity->getTemporarySecret(), \Yii::$app->request->post()['code'] ?? '')) {
202
            return ['_error' => 'invalid totp code'];
203
        }
204
205
        $identity->setTotpSecret($identity->getTemporarySecret());
206
        $identity->setTemporarySecret(null);
@@ 221-223 (lines=3) @@
218
            return ['_error' => 'mfa disabled, enable first'];
219
        }
220
221
        if (!$this->module->getTotp()->verifyCode($secret, \Yii::$app->request->post()['code'] ?? '')) {
222
            return ['_error' => 'wrong code'];
223
        }
224
225
        $identity->setTotpSecret('');
226
        $identity->save();