Skip to content

Commit

Permalink
Update: Respect config settings for is 2fa required
Browse files Browse the repository at this point in the history
  • Loading branch information
cannycookie committed Oct 30, 2024
1 parent cfd892a commit 8108ac9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Filament/Pages/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ protected function handleTwoFactorAuthentication(Authenticatable $user, array $c
*/
protected function needsTwoFactorAuthentication(Authenticatable $user): bool
{
$authGuard = Filament::getAuthGuard();
return $user instanceof TwoFactorAuthenticatable
&& array_key_exists($authGuard, config('filament-2fa.auth_guards'))
&& config("filament-2fa.auth_guards.$authGuard.enabled")
&& $user->hasTwoFactorEnabled()
&& ! $user->isSafeDevice(request());
}
Expand Down

0 comments on commit 8108ac9

Please sign in to comment.