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);