Rector code cleanup

This commit is contained in:
James Cole
2025-05-24 16:39:20 +02:00
parent 6a82a813e0
commit 6e5a08245c
62 changed files with 172 additions and 115 deletions

View File

@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Profile;
use Cookie;
use Google2FA;
use Carbon\Carbon;
use FireflyIII\Events\Security\DisabledMFA;
use FireflyIII\Events\Security\EnabledMFA;
@@ -182,7 +184,7 @@ class MfaController extends Controller
// also logout current 2FA tokens.
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
\Cookie::forget($cookieName);
Cookie::forget($cookieName);
// send user notification.
Log::channel('audit')->info(sprintf('User "%s" has disabled MFA', $user->email));
@@ -215,8 +217,8 @@ class MfaController extends Controller
}
$domain = $this->getDomain();
$secret = \Google2FA::generateSecretKey();
$image = \Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
$secret = Google2FA::generateSecretKey();
$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
app('preferences')->set('temp-mfa-secret', $secret);
@@ -272,7 +274,7 @@ class MfaController extends Controller
// make sure MFA is logged out.
if ('testing' !== config('app.env')) {
\Google2FA::logout();
Google2FA::logout();
}
// drop all info from session: