You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ForceTwoFactor middleware triggered before Filament Authenticate authMiddleware #85
The authenticated user is not known when ForceTwoFactor middleware runs. This is solved by not using TwoFactorAuthPlugin::make()->forced() but just TwoFactorAuthPlugin::make() and manually registering the ForceTwoFactor middlware:
Hi, just to add to this: I'm finding that when adding the middleware manually, it get's stuck in a loop on email-verification/prompt screen when verifying new accounts.
I had to resolve by adding another request pattern to the handle
public function handle(Request $request, Closure $next): mixed
{
$user = Filament::auth()->user();
if ($request->is('*email-verification*') || $request->is('*two-factor') || $request->is('*logout')) {
return $next($request);
}
...
This might be worth double checking when you introduce a fix
Activity
leonadarr commentedon Apr 1, 2025
Hi, just to add to this: I'm finding that when adding the middleware manually, it get's stuck in a loop on email-verification/prompt screen when verifying new accounts.
I had to resolve by adding another request pattern to the handle
This might be worth double checking when you introduce a fix