Skip to content

Commit

Permalink
fix ShareInertiaData middleware to play nicely with strict mode (prev…
Browse files Browse the repository at this point in the history
…entAccessingMissingAttributes) on disabled 2FA (#1319)
  • Loading branch information
onlime authored Jun 7, 2023
1 parent 397bd87 commit c65656c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Middleware/ShareInertiaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]);
},
],
Expand Down

0 comments on commit c65656c

Please sign in to comment.