Skip to content

Commit

Permalink
Merge branch 'main' of github.com:vormkracht10/filament-two-factor-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Aug 16, 2024
2 parents 38aade7 + f99a55d commit bbb2afb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/Http/Livewire/Auth/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

namespace Vormkracht10\TwoFactorAuth\Http\Livewire\Auth;

use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
use Filament\Actions\Action;
use Illuminate\Http\Request;
use Laravel\Fortify\Fortify;
use Laravel\Fortify\Features;
use Filament\Facades\Filament;
use Illuminate\Routing\Pipeline;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Facades\Blade;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\Component;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Filament\Models\Contracts\FilamentUser;
use Filament\Notifications\Notification;
use Filament\Pages\Auth\Login as BaseLogin;
use Laravel\Fortify\Actions\CanonicalizeUsername;
use Illuminate\Http\Request;
use Illuminate\Routing\Pipeline;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\HtmlString;
use Laravel\Fortify\Actions\AttemptToAuthenticate;
use Laravel\Fortify\Actions\CanonicalizeUsername;
use Laravel\Fortify\Actions\EnsureLoginIsNotThrottled;
use Laravel\Fortify\Actions\PrepareAuthenticatedSession;
use Vormkracht10\TwoFactorAuth\Http\Responses\LoginResponse;
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
use Laravel\Fortify\Features;
use Laravel\Fortify\Fortify;
use Vormkracht10\TwoFactorAuth\Http\Middleware\RedirectIfTwoFactorAuthenticatable;
use Vormkracht10\TwoFactorAuth\Http\Responses\LoginResponse;

class Login extends BaseLogin
{
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Middleware/RedirectIfTwoFactorAuthenticatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Vormkracht10\TwoFactorAuth\Http\Middleware;

use Laravel\Fortify\Actions\RedirectIfTwoFactorAuthenticatable as DefaultRedirectIfTwoFactorAuthenticatable;
use Laravel\Fortify\Fortify;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Fortify\Actions\RedirectIfTwoFactorAuthenticatable as DefaultRedirectIfTwoFactorAuthenticatable;

class RedirectIfTwoFactorAuthenticatable extends DefaultRedirectIfTwoFactorAuthenticatable
{
Expand All @@ -22,7 +22,7 @@ public function handle($request, $next)
if (Fortify::confirmsTwoFactorAuthentication()) {
if (
optional($user)->two_factor_secret &&
!is_null(optional($user)->two_factor_confirmed_at) &&
! is_null(optional($user)->two_factor_confirmed_at) &&
in_array(TwoFactorAuthenticatable::class, class_uses_recursive($user))
) {
return $this->twoFactorChallengeResponse($request, $user);
Expand Down

0 comments on commit bbb2afb

Please sign in to comment.