Skip to content

Two factor story#4

Merged
zacksmash merged 3 commits into
mainfrom
two-factor-story
Sep 10, 2025
Merged

Two factor story#4
zacksmash merged 3 commits into
mainfrom
two-factor-story

Conversation

@zacksmash
Copy link
Copy Markdown
Owner

This PR adds a better and more comprehensive two-factor authentication story in the dashboard.

This pull request introduces a significant refactor and feature enhancement for two-factor authentication (2FA) in the application. The main changes include a complete rewrite of the 2FA settings UI to support confirmation workflows, improved recovery code management, and a new password confirmation modal component. Additionally, the backend logic for sharing 2FA status with the frontend has been updated, and several codebase improvements were made to streamline feature flags and dependency management.

Two-Factor Authentication Improvements

  • Rewrote TwoFactorAuth.vue to support 2FA confirmation, QR code and setup key display, recovery code management, and improved UI/UX. Added support for enabling/disabling 2FA, confirming setup, and regenerating recovery codes, all gated by password confirmation using the new modal component.
  • Added a reusable ConfirmsPassword.vue component for password confirmation modals, used throughout 2FA flows to secure sensitive actions.

Backend and Feature Flag Updates

  • Updated HandleInertiaRequests.php to share two_factor_enabled status with the frontend, using Fortify features and user secrets for accurate state.
  • Refactored routes/web.php to use new Fortify feature flag helpers for dashboard props, simplifying 2FA and profile/password management logic.

UI and Dependency Enhancements

  • Added custom dialog styles for modals and improved button spacing in app.css to support the new password confirmation modal and enhance overall UI consistency. [1] [2]
  • Added axios as a dependency for API requests in the frontend, supporting the new 2FA and password confirmation flows.

These changes collectively improve the security, usability, and maintainability of the authentication system, especially around two-factor authentication management.

@zacksmash zacksmash requested a review from Copilot September 10, 2025 20:39
@zacksmash zacksmash self-assigned this Sep 10, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a comprehensive two-factor authentication system with enhanced user experience, including password confirmation flows, improved UI/UX, and better state management. The changes modernize the 2FA implementation to provide a more secure and user-friendly authentication experience.

  • Complete rewrite of the 2FA settings component with confirmation workflows and recovery code management
  • Introduction of a reusable password confirmation modal component for securing sensitive actions
  • Backend improvements to share 2FA status with the frontend and simplify feature flag usage

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
routes/web.php Simplified Fortify feature flag usage and removed deprecated 2FA props from dashboard route
resources/js/pages/settings/TwoFactorAuth.vue Complete rewrite with modern Vue composition API, password confirmation integration, and comprehensive 2FA management
resources/js/pages/settings/Password.vue Added hidden email field for improved browser autocomplete behavior
resources/js/pages/Dashboard.vue Re-enabled TwoFactorAuth component with confirmation support
resources/js/components/ConfirmsPassword.vue New reusable password confirmation modal component
resources/css/app.css Added dialog styles and button spacing for modal support
package.json Added axios dependency for API requests
app/Http/Middleware/HandleInertiaRequests.php Enhanced user data sharing to include 2FA enabled status
README.md Updated installation instructions removing outdated dashboard uncomment step

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/components/ConfirmsPassword.vue
Comment thread resources/js/components/ConfirmsPassword.vue
Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/pages/settings/TwoFactorAuth.vue
Comment thread resources/js/components/ConfirmsPassword.vue
@zacksmash zacksmash merged commit 5386907 into main Sep 10, 2025
2 checks passed
@zacksmash zacksmash deleted the two-factor-story branch September 10, 2025 21:05
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.

2 participants