Feature: Reusable MultiFactorChallenge class - #20353
Open
webard wants to merge 2 commits into
Open
Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Pull Request extracts OTP functionality from
Logininto a separateMultiFactorChallengeclass, making it possible to use this functionality outside the Login page.The motivation for this change is work on a solution that allows actions to be confirmed with a one-time code. This is very useful for actions such as destructive operations.
Of course, this can be achieved without this change, but while working on it I thought that extracting this functionality into an external class would let authors reuse it in their own solutions.
The translation key stayed under login. The provider switcher still uses
filament-panels::auth/pages/login.multi_factor.form.provider.label, even though the component no longer lives inLogin. Moving the key would touch all localization files and would cause a regression in languages where the translation has not been added yet. I’m happy to move it if you prefer.MultiFactorAuthenticationProvider::getLoginFormLabel()is now used outside login. The name no longer fully matches the usage, but renaming a method in a public interface would break providers outside core, so I’m leaving it unchanged.Functional changes
composer cscommand.