Add two-factor authentication component, including forms, pages, midd… #46
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.
Two-Factor Authentication :
Step 1 install laravel fortify and configure it :
Setting the configuration of twoFactorAuthentication in config/fority.php :
Add trait TwoFactorAuthenticatable in User model :
Step 2: Check if Sanctum is installed in your application. If it isn't, install it :
php artisan install:api
use Laravel\Sanctum\HasApiTokens;
Step 3 Add two factor form in edit profile page :
Add the shouldShowTwoFactorForm function and set it to true :
Form for when two-factor authentication is disabled :
Form for when two-factor authentication is enabled :
For disabled it click on the button and insert your password
Step 4 add two factor page :
/admin/two-factor
route:Update the login form in the admin panel provided by the login of the profile edit plugin :
Add two-factor authentication middleware in the authMiddleware of Filament :
Two-factor authentication page for approval using a code or recovery codes :