user(); $available = (bool) config('auth-ui.features.two_factor'); $pending = $available && filled($user->two_factor_secret) && ! $user->hasEnabledTwoFactorAuthentication(); return Inertia::render('Profile/Show', [ 'twoFactor' => [ 'available' => $available, 'enabled' => $available && $user->hasEnabledTwoFactorAuthentication(), 'pending' => $pending, 'requiresPassword' => $user->hasPassword(), 'qrCodeDataUri' => $pending ? 'data:image/svg+xml;base64,'.base64_encode($user->twoFactorQrCodeSvg()) : null, 'secretKey' => $pending ? Fortify::currentEncrypter()->decrypt($user->two_factor_secret) : null, ], ]); } }