Prevented inadvertant logging during MFA flow

- Added StoppedAuthenticationException to dontReport list.
- Added test to cover.

Closes #3468
This commit is contained in:
Dan Brown 2022-05-30 18:31:08 +01:00
parent 43cbab2822
commit 16e023985d
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 11 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class Handler extends ExceptionHandler
*/
protected $dontReport = [
NotFoundException::class,
StoppedAuthenticationException::class,
];
/**

View File

@ -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>
*/