| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 73 | public function verifyCode(): bool |
||
| 74 | { |
||
| 75 | $recoveryCodes = self::findAll(['user_id' => $this->getUser()]); |
||
| 76 | |||
| 77 | foreach ($recoveryCodes ?? [] as $recoveryCode){ |
||
| 78 | if (Yii::$app->getSecurity()->validatePassword($this->getCode(), $recoveryCode->getCode())){ |
||
| 79 | $recoveryCode->delete(); |
||
| 80 | return true; |
||
| 81 | } |
||
| 82 | } |
||
| 83 | |||
| 84 | return false; |
||
| 85 | } |
||
| 86 | |||
| 91 | } |