diff --git a/src/Http/Middleware/ShareInertiaData.php b/src/Http/Middleware/ShareInertiaData.php index d3a5601c4..80c266358 100644 --- a/src/Http/Middleware/ShareInertiaData.php +++ b/src/Http/Middleware/ShareInertiaData.php @@ -54,7 +54,8 @@ public function handle($request, $next) return array_merge($user->toArray(), array_filter([ 'all_teams' => $userHasTeamFeatures ? $user->allTeams()->values() : null, ]), [ - 'two_factor_enabled' => ! is_null($user->two_factor_secret), + 'two_factor_enabled' => Features::enabled(Features::twoFactorAuthentication()) + && ! is_null($user->two_factor_secret), ]); }, ],