Skip to content

Commit c65656c

Browse files
authored
fix ShareInertiaData middleware to play nicely with strict mode (preventAccessingMissingAttributes) on disabled 2FA (#1319)
1 parent 397bd87 commit c65656c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Http/Middleware/ShareInertiaData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public function handle($request, $next)
5454
return array_merge($user->toArray(), array_filter([
5555
'all_teams' => $userHasTeamFeatures ? $user->allTeams()->values() : null,
5656
]), [
57-
'two_factor_enabled' => ! is_null($user->two_factor_secret),
57+
'two_factor_enabled' => Features::enabled(Features::twoFactorAuthentication())
58+
&& ! is_null($user->two_factor_secret),
5859
]);
5960
},
6061
],

0 commit comments

Comments
 (0)