Skip to content

Commit

Permalink
fix plugin not enabled redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
angie committed Jun 21, 2024
1 parent 01c71db commit 2ea3d75
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Responses/TwoFAResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ public function toResponse($request)
{
// return whatever you want as url

Filament::auth()->user()->send2FAEmail();

return redirect()->intended(route(TwoFactorAuth::getRouteName()));
if (Filament::getCurrentPanel()->hasPlugin('filament-email-2fa')); {
Filament::auth()->user()->send2FAEmail();

Check failure on line 23 in src/Responses/TwoFAResponse.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Illuminate\Foundation\Auth\User::send2FAEmail().
return redirect()->intended(route(TwoFactorAuth::getRouteName()));
}
return redirect()->intended(Filament::getUrl());

Check failure on line 26 in src/Responses/TwoFAResponse.php

View workflow job for this annotation

GitHub Actions / phpstan

Unreachable statement - code above always terminates.

}
}

0 comments on commit 2ea3d75

Please sign in to comment.