From 2deed4c21ba25110ca1093309adce00edd56928d Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 11 Sep 2024 17:47:06 +0930 Subject: [PATCH] for mfa verification don't require validation for updating last login --- application/features/bootstrap/MfaContext.php | 1 - application/frontend/controllers/MfaController.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/application/features/bootstrap/MfaContext.php b/application/features/bootstrap/MfaContext.php index bc051da0..340acb23 100644 --- a/application/features/bootstrap/MfaContext.php +++ b/application/features/bootstrap/MfaContext.php @@ -3,7 +3,6 @@ namespace Sil\SilIdBroker\Behat\Context; use Behat\Gherkin\Node\TableNode; -use common\models\EmailLog; use common\models\Mfa; use common\models\MfaBackupcode; use common\models\MfaWebauthn; diff --git a/application/frontend/controllers/MfaController.php b/application/frontend/controllers/MfaController.php index b9fc3347..379018aa 100644 --- a/application/frontend/controllers/MfaController.php +++ b/application/frontend/controllers/MfaController.php @@ -63,7 +63,7 @@ public function actionCreate() * @throws TooManyRequestsHttpException * @return null */ - public function actionVerify(int $id, string $type = "") + public function actionVerify(int $id, string $type = ""): Mfa { $req = \Yii::$app->request; $value = $req->getBodyParam('value'); @@ -116,7 +116,7 @@ public function actionVerify(int $id, string $type = "") } $mfa->loadData($rpOrigin); $user->last_login_utc = MySqlDateTime::now(); - if (!$user->save()) { + if (!$user->save(false)) { \Yii::error([ 'action' => 'save last_login_utc for user after mfa verification', 'status' => 'error',