What happened?
Not forced to set 2FA when using TwoFactorAuthPlugin::make()->forced().
How to reproduce the bug
Set TwoFactorAuthPlugin::make()->forced() in your panelprovider plugins array:
...
->plugins([
TwoFactorAuthPlugin::make()->forced(),
])
...
Have authMiddlware set in your panelprovider:
...
->authMiddleware([
Authenticate::class,
])
...
Repository
No response
Package Version
2.1.3
PHP Version
8.4
Laravel Version
11.44.1
Which operating systems does with happen with?
macOS
Notes
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:
...
->middleware([
...
ForceTwoFactor::class,
])
->authMiddleware([
Authenticate::class,
])
...
Now the auth user is available in the ForceTwoFactor middleware and the logic works as expected.
What happened?
Not forced to set 2FA when using
TwoFactorAuthPlugin::make()->forced().How to reproduce the bug
Set
TwoFactorAuthPlugin::make()->forced()in your panelproviderpluginsarray:Have authMiddlware set in your panelprovider:
Repository
No response
Package Version
2.1.3
PHP Version
8.4
Laravel Version
11.44.1
Which operating systems does with happen with?
macOS
Notes
The authenticated user is not known when ForceTwoFactor middleware runs. This is solved by not using
TwoFactorAuthPlugin::make()->forced()but justTwoFactorAuthPlugin::make()and manually registering the ForceTwoFactor middlware:Now the auth user is available in the ForceTwoFactor middleware and the logic works as expected.