adding new two-factor auth stuff to user profile controller

This commit is contained in:
Brian 2022-05-20 13:50:18 -06:00
parent 5f9d23e24a
commit 5b8a3b3714
Signed by: brian
GPG Key ID: DE1A5390A3B84CD8

View File

@ -9,10 +9,14 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Inertia\Response; use Inertia\Response;
use Jenssegers\Agent\Agent; use Jenssegers\Agent\Agent;
use Laravel\Fortify\Features;
use Laravel\Jetstream\Http\Controllers\Inertia\Concerns\ConfirmsTwoFactorAuthentication;
use Laravel\Jetstream\Jetstream; use Laravel\Jetstream\Jetstream;
class UserProfileController extends Controller class UserProfileController extends Controller
{ {
use ConfirmsTwoFactorAuthentication;
/** /**
* Show the general profile settings screen. * Show the general profile settings screen.
* *
@ -27,8 +31,9 @@ class UserProfileController extends Controller
$this->validateTwoFactorAuthenticationState($request); $this->validateTwoFactorAuthenticationState($request);
return Jetstream::inertia()->render($request, 'Profile/Show', [ return Jetstream::inertia()->render($request, 'Profile/Show', [
'sessions' => $this->sessions($request)->all(), 'confirmsTwoFactorAuthentication' => Features::optionEnabled(Features::twoFactorAuthentication(), 'confirm'),
'timezones' => timezone_identifiers_list(), 'sessions' => $this->sessions($request)->all(),
'timezones' => timezone_identifiers_list(),
]); ]);
} }