From d0201e3dc553807eaa515b8456b59f45668039c2 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 5 Jun 2025 16:37:08 +0200 Subject: [PATCH] CS fixes --- app/Http/Controllers/PasswordSecurityController.php | 1 + app/Http/Controllers/ProfileController.php | 2 +- app/Http/Controllers/ProfileSecurityController.php | 11 +++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/PasswordSecurityController.php b/app/Http/Controllers/PasswordSecurityController.php index 4f196aa4c..a5c8f2636 100644 --- a/app/Http/Controllers/PasswordSecurityController.php +++ b/app/Http/Controllers/PasswordSecurityController.php @@ -92,6 +92,7 @@ class PasswordSecurityController extends Controller if ($request->has('redirect_to_profile') || $request->has('from_profile')) { return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.'); } + return redirect()->back()->with('error', 'Your password does not match with your account password. Please try again.'); } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index f1d72da93..602b9278c 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -122,7 +122,7 @@ class ProfileController extends BasePageController // Generate 2FA QR code URL if 2FA is set up but not enabled $google2fa_url = ''; - if ($this->userdata->passwordSecurity()->exists() && !$this->userdata->passwordSecurity->google2fa_enable) { + if ($this->userdata->passwordSecurity()->exists() && ! $this->userdata->passwordSecurity->google2fa_enable) { $google2fa_url = \Google2FA::getQRCodeInline( config('app.name'), $this->userdata->email, diff --git a/app/Http/Controllers/ProfileSecurityController.php b/app/Http/Controllers/ProfileSecurityController.php index 0ea33f6c9..6a2d03954 100644 --- a/app/Http/Controllers/ProfileSecurityController.php +++ b/app/Http/Controllers/ProfileSecurityController.php @@ -3,9 +3,9 @@ namespace App\Http\Controllers; use App\Models\User; -use Illuminate\Http\Request; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; @@ -19,7 +19,6 @@ class ProfileSecurityController extends BasePageController * Disable 2FA for the authenticated user from the profile page * This is separate from the main profile edit functionality * - * @param Request $request * @return JsonResponse|RedirectResponse */ public function disable2fa(Request $request) @@ -30,11 +29,11 @@ class ProfileSecurityController extends BasePageController ]); // Check if password is correct - if (!Hash::check($validated['current_password'], Auth::user()->password)) { + if (! Hash::check($validated['current_password'], Auth::user()->password)) { if ($request->expectsJson() || $request->ajax()) { return response()->json([ 'success' => false, - 'message' => 'Your password does not match. Please try again.' + 'message' => 'Your password does not match. Please try again.', ]); } @@ -52,7 +51,7 @@ class ProfileSecurityController extends BasePageController if ($request->expectsJson() || $request->ajax()) { return response()->json([ 'success' => true, - 'message' => '2FA has been successfully disabled.' + 'message' => '2FA has been successfully disabled.', ]); } @@ -64,7 +63,7 @@ class ProfileSecurityController extends BasePageController if ($request->expectsJson() || $request->ajax()) { return response()->json([ 'success' => false, - 'message' => 'No 2FA configuration found for this user.' + 'message' => 'No 2FA configuration found for this user.', ]); }