Conversation
|
Thank you for submitting PR. You can keep the PR open to gather feedback from the community, or it might be better to inform them on the forum or Slack. |
|
With all due respect, given that your PRs are quite large, I kindly suggest using the atomic commit approach. This will make the review process easier and faster for others. Smaller, more focused commits allow the team to review changes more efficiently. Additionally, if possible, please consider writing your commit messages in a way that provides a clear and concise explanation of the changes. |
|
I'm afraid that a breaking change at this stage of the library (in v1) is not an option. We can improve the way we handle actions, but it must be an evolution, not a revolution. |
Although Shield currently offers 2FA, its support is somewhat limited. Like this discussion #1120, I also feel that it could benefit from a more robust system, like supporting multiple 2FA systems, allowing global/per user 2FA, or setting custom 2FA actions per user group, like suggested in discussions.
I would love to know what you think.
Description
This PR expands support of 2FA actions for Shield. It allows having multiple active 2FA methods, per-user or site-wide 2FA, per-group custom 2FA action, and a default. The settings
$Mfa,$forceMfa,$actionsMfa,$defaultMfaand$matrixMfaare introduced to theAuthconfig file to control these settings. The per-user 2FA is achieved through a new column namedmfain the user table acting as a flag. TheUserEntity introduces theisMfaActive() :boolmethod for easy access to the property.Within the
Authenticators/Session.php:511, currently, theauth_action_messageis being assigned the extra field directly. Expanding the 2FA actions, that extra field may be useful to store data related to the identity, so theActionInterfaceintroduces thegetActionMessage() :stringmethod to get thisauth_action_messagevalue from the action.These changes introduce breaking changes to past versions.
Implements #1120
Checklist: