I'm using Fortify to implement 2FA in an application.
Activate or deactivate 2FA needs to type the account password to confirm the action.
But => I click on the activation button, the password confirmation form is displayed and then, instead of being redirected to the next route with the QR code to confirm the 2FA configuration, I am redirected to the previous route and I have once again to click on the activation button.
I found a way around the problem : I have deactivated the confirmPassword configuration for Fortify and I have protected the route to show the show two factor view with the password.confirm middleware.
This way the password confirmation is already done and the user can modify what he needs for the two factor authentication.
I mean, I have deactivated the confirmPassword configuration for Fortify, so that Fortify doesn't ask anymore to confirm the password if the user wants to change his 2FA configuration.
And I have protected the route to display the 2FA configuration page with the password.confirm middleware, which is the same used by Fortify.
This way when a user wants to activate or deactivate 2FA for his account, before accessing the 2FA page, he needs to confirm his password.