Skip to content

NOW MANAGED ON CODEBERG

Prevented inadvertant logging during MFA flow

Dan Brown16e023985d24
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 317b011d8..187664f9e 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -21,6 +21,7 @@ class Handler extends ExceptionHandler
*/
protected $dontReport = [
NotFoundException::class,
+ StoppedAuthenticationException::class,
];
/**
diff --git a/tests/Auth/MfaVerificationTest.php b/tests/Auth/MfaVerificationTest.php
index 9a6106243..7286a1de8 100644
--- a/tests/Auth/MfaVerificationTest.php
+++ b/tests/Auth/MfaVerificationTest.php
@@ -241,6 +241,16 @@ class MfaVerificationTest extends TestCase
}
}
+ public function test_login_mfa_interception_does_not_log_error()
+ {
+ $logHandler = $this->withTestLogger();
+
+ [$user, $secret, $loginResp] = $this->startTotpLogin();
+
+ $loginResp->assertRedirect('/mfa/verify');
+ $this->assertFalse($logHandler->hasErrorRecords());
+ }
+
/**
* @return array<User, string, TestResponse>
*/