mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-02-03 11:02:54 +00:00
🤖 Auto commit for release 'develop' on 2026-01-23
This commit is contained in:
@@ -66,8 +66,8 @@ class TwoFactorController extends Controller
|
||||
public function submitMFA(Request $request): Redirector|RedirectResponse
|
||||
{
|
||||
/** @var array $mfaHistory */
|
||||
$mfaHistory = Preferences::get('mfa_history', [])->data;
|
||||
$mfaCode = (string) $request->get('one_time_password');
|
||||
$mfaHistory = Preferences::get('mfa_history', [])->data;
|
||||
$mfaCode = (string) $request->get('one_time_password');
|
||||
|
||||
// is in history? then refuse to use it.
|
||||
if ($this->inMFAHistory($mfaCode, $mfaHistory)) {
|
||||
@@ -82,7 +82,7 @@ class TwoFactorController extends Controller
|
||||
|
||||
// if not OK, save error.
|
||||
if (!$authenticator->isAuthenticated()) {
|
||||
$user = auth()->user();
|
||||
$user = auth()->user();
|
||||
$this->addToMFAFailureCounter();
|
||||
$counter = $this->getMFAFailureCounter();
|
||||
if (3 === $counter || 10 === $counter) {
|
||||
@@ -182,8 +182,8 @@ class TwoFactorController extends Controller
|
||||
private function addToMFAHistory(string $mfaCode): void
|
||||
{
|
||||
/** @var array $mfaHistory */
|
||||
$mfaHistory = Preferences::get('mfa_history', [])->data;
|
||||
$entry = ['time' => Carbon::now()->getTimestamp(), 'code' => $mfaCode];
|
||||
$mfaHistory = Preferences::get('mfa_history', [])->data;
|
||||
$entry = ['time' => Carbon::now()->getTimestamp(), 'code' => $mfaCode];
|
||||
$mfaHistory[] = $entry;
|
||||
|
||||
Preferences::set('mfa_history', $mfaHistory);
|
||||
@@ -214,7 +214,7 @@ class TwoFactorController extends Controller
|
||||
*/
|
||||
private function removeFromBackupCodes(string $mfaCode): void
|
||||
{
|
||||
$list = Preferences::get('mfa_recovery', [])->data;
|
||||
$list = Preferences::get('mfa_recovery', [])->data;
|
||||
if (!is_array($list)) {
|
||||
$list = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user