From f532b56abb4da2483162cd7660c6a632799771ca Mon Sep 17 00:00:00 2001 From: Saeed Vaziry Date: Fri, 27 Jun 2025 08:39:18 +0200 Subject: [PATCH] disable 2fa on demo --- app/Http/Controllers/ProfileController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 5cf35ebd..31e0af54 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -72,6 +72,10 @@ public function password(Request $request): RedirectResponse #[Post('/enable-two-factor', name: 'profile.enable-two-factor')] public function enableTwoFactor(): RedirectResponse { + if (config('app.demo')) { + return back()->with('error', 'Two factor authentication cannot be enabled in demo mode.'); + } + $user = user(); app(EnableTwoFactorAuthentication::class)($user);