Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: 2FA #256

Merged
merged 33 commits into from
Jul 30, 2024
Merged

[WIP] feat: 2FA #256

merged 33 commits into from
Jul 30, 2024

Conversation

franbarbalopez
Copy link
Contributor

@franbarbalopez franbarbalopez commented Apr 25, 2024

  • Livewire component for 2FA
  • Now app use Fortify Login with 2FA confirmation if 2FA is enabled on that user
  • Added livewire component on profile view
image image image image
  • password confirmation

image

  • OTP verification
    image

@franbarbalopez franbarbalopez changed the title Feat - 2FA Feature - 2FA Apr 25, 2024
@franbarbalopez franbarbalopez linked an issue Apr 25, 2024 that may be closed by this pull request
Copy link
Member

@nunomaduro nunomaduro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you address the feedback, can rebase the PR please?

tests/Http/LoginTest.php Show resolved Hide resolved
tests/Http/LoginTest.php Show resolved Hide resolved
@nunomaduro nunomaduro changed the title Feature - 2FA [WIP] feat: 2FA May 4, 2024
@franbarbalopez
Copy link
Contributor Author

@nunomaduro this is ready to merge

@franbarbalopez franbarbalopez changed the title [WIP] feat: 2FA feat: 2FA May 14, 2024
@MrPunyapal MrPunyapal force-pushed the feat/two-factor-authentication branch from 63d8a0e to 300bdad Compare July 20, 2024 09:55
@MrPunyapal MrPunyapal changed the title feat: 2FA [WIP] feat: 2FA Jul 21, 2024
@MrPunyapal MrPunyapal force-pushed the feat/two-factor-authentication branch from 490ab14 to 4b4988a Compare July 24, 2024 16:42
@MrPunyapal MrPunyapal force-pushed the feat/two-factor-authentication branch from 4b4988a to c1eb758 Compare July 29, 2024 14:21
The TwoFactorAuthenticationForm component has been refactored to improve code organization and readability. The changes include:
- Adding the `User` model to the component's namespace
- Adding the `Locked` attribute to the `showingQrCode`, `showingRecoveryCodes`, `code`, and `enabled` properties
- Updating the `mount` method to set the `enabled` property based on the user's two-factor secret
- Adding conditional checks in the `showRecoveryCodes` and `regenerateRecoveryCodes` methods to prevent execution when two-factor authentication is not enabled
- Updating the `disableTwoFactorAuthentication` method to set the `enabled` property to false

These changes aim to improve the maintainability and extensibility of the TwoFactorAuthenticationForm component.
The TwoFactorAuthenticationForm component has been refactored to improve code organization and readability. Changes include adding the `User` model to the component's namespace, introducing the `Locked` attribute to relevant properties, updating the `mount` method to set the `enabled` property based on the user's two-factor secret, and adding conditional checks in methods to prevent execution when two-factor authentication is not enabled. The `disableTwoFactorAuthentication` method has also been updated to set the `enabled` property to false. These changes aim to enhance the maintainability and extensibility of the TwoFactorAuthenticationForm component.
Refactor the TwoFactorAuthenticationForm component to improve code organization and readability. Changes include adding the User model to the component's namespace, introducing the Locked attribute to relevant properties, updating the mount method to set the enabled property based on the user's two-factor secret, and adding conditional checks in methods to prevent execution when two-factor authentication is not enabled. The disableTwoFactorAuthentication method has also been updated to set the enabled property to false. These changes aim to enhance the maintainability and extensibility of the TwoFactorAuthenticationForm component.
…nfiguration

Update the `fortify.php` configuration file to enable the confirmation of two-factor authentication during the authentication process. This change sets the `confirm` option to `true` and the `confirmPassword` option to `true` in the `twoFactorAuthentication` feature configuration. This ensures that users are required to confirm their two-factor authentication setup by entering their password. This improvement enhances the security of the application by adding an extra layer of verification for two-factor authentication.
Refactor the TwoFactorAuthenticationForm component to improve code organization and readability. Changes include adding the User model to the component's namespace, introducing the Locked attribute to relevant properties, updating the mount method to set the enabled property based on the user's two-factor secret, and adding conditional checks in methods to prevent execution when two-factor authentication is not enabled. The disableTwoFactorAuthentication method has also been updated to set the enabled property to false. These changes aim to enhance the maintainability and extensibility of the TwoFactorAuthenticationForm component.
Refactor the TwoFactorAuthenticationForm component to improve code organization and readability. Changes include adding the User model to the component's namespace, introducing the Locked attribute to relevant properties, updating the mount method to set the enabled property based on the user's two-factor secret, and adding conditional checks in methods to prevent execution when two-factor authentication is not enabled. The disableTwoFactorAuthentication method has also been updated to set the enabled property to false. These changes aim to enhance the maintainability and extensibility of the TwoFactorAuthenticationForm component.
…cationFormTest.php

The file `TwoFactorAuthenticationTest.php` has been renamed to `TwoFactorAuthenticationFormTest.php` to better reflect its purpose as a test for the `TwoFactorAuthenticationForm` component. This change improves code organization and maintainability.
@MrPunyapal MrPunyapal force-pushed the feat/two-factor-authentication branch from de194ec to f73f76e Compare July 30, 2024 05:08
…oFactorAuthenticationForm

The ConfirmsPasswords trait has been added to the TwoFactorAuthenticationForm component to handle password confirmation. This trait provides methods to ensure that the user's password has been recently confirmed. This change improves the security and usability of the TwoFactorAuthenticationForm component by requiring password confirmation before performing sensitive actions.
Refactor the TwoFactorAuthenticationForm component to improve code organization and readability. Changes include adding the User model to the component's namespace, introducing the Locked attribute to relevant properties, updating the mount method to set the enabled property based on the user's two-factor secret, and adding conditional checks in methods to prevent execution when two-factor authentication is not enabled. The disableTwoFactorAuthentication method has also been updated to set the enabled property to false. These changes aim to enhance the maintainability and extensibility of the TwoFactorAuthenticationForm component.
Refactor the TwoFactorAuthenticationForm component to improve code organization and readability. Changes include adding the User model to the component's namespace, introducing the Locked attribute to relevant properties, updating the mount method to set the enabled property based on the user's two-factor secret, and adding conditional checks in methods to prevent execution when two-factor authentication is not enabled. The disableTwoFactorAuthentication method has also been updated to set the enabled property to false. These changes aim to enhance the maintainability and extensibility of the TwoFactorAuthenticationForm component.
Add the two_factor_secret, two_factor_recovery_codes, and two_factor_confirmed_at properties to the User model. This allows for the storage and retrieval of two-factor authentication information for users. The changes include updating the casts() method in the User model to include the new properties. This enhancement improves the functionality and security of the User model.
@nunomaduro nunomaduro merged commit 470d46c into main Jul 30, 2024
@nunomaduro nunomaduro deleted the feat/two-factor-authentication branch July 30, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: allow 2FA
3 participants