From 5b8a3b37143ac5fd571dab9e544f31ebe45bcc06 Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Fri, 20 May 2022 13:50:18 -0600 Subject: [PATCH] adding new two-factor auth stuff to user profile controller --- .../Http/Controllers/Dashboard/UserProfileController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/Http/Controllers/Dashboard/UserProfileController.php b/src/app/Http/Controllers/Dashboard/UserProfileController.php index 6873b30..bc7733a 100644 --- a/src/app/Http/Controllers/Dashboard/UserProfileController.php +++ b/src/app/Http/Controllers/Dashboard/UserProfileController.php @@ -9,10 +9,14 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Inertia\Response; use Jenssegers\Agent\Agent; +use Laravel\Fortify\Features; +use Laravel\Jetstream\Http\Controllers\Inertia\Concerns\ConfirmsTwoFactorAuthentication; use Laravel\Jetstream\Jetstream; class UserProfileController extends Controller { + use ConfirmsTwoFactorAuthentication; + /** * Show the general profile settings screen. * @@ -27,8 +31,9 @@ class UserProfileController extends Controller $this->validateTwoFactorAuthenticationState($request); return Jetstream::inertia()->render($request, 'Profile/Show', [ - 'sessions' => $this->sessions($request)->all(), - 'timezones' => timezone_identifiers_list(), + 'confirmsTwoFactorAuthentication' => Features::optionEnabled(Features::twoFactorAuthentication(), 'confirm'), + 'sessions' => $this->sessions($request)->all(), + 'timezones' => timezone_identifiers_list(), ]); }