Skip to content

Conversation

@dvlpp
Copy link
Member

@dvlpp dvlpp commented Oct 30, 2025

Adds an helper (trait) to simplify the creation of a password change command

@dvlpp dvlpp requested a review from Copilot October 31, 2025 10:10
Copy link

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 introduces a reusable trait for building password change commands in Sharp. It provides a standardized way for authenticated users to change their own passwords with configurable validation rules, optional password confirmation, and built-in rate limiting protection.

  • Adds IsChangePasswordCommandTrait with configurable password change functionality
  • Implements rate limiting (3 attempts) with localized error messages
  • Updates demo application to use the new trait instead of custom implementation

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Auth/Password/Command/IsChangePasswordCommandTrait.php New trait providing password change form fields, validation rules, and rate limiting
tests/Http/Auth/ChangePasswordCommandTraitTest.php Comprehensive test coverage for all trait features including rate limiting, confirmation, and validation
resources/lang/en/auth.php English translations for password change command labels and messages
resources/lang/fr/auth.php French translations for password change command labels and messages
docs/guide/authentication.md Documentation explaining trait usage with configuration examples
demo/app/Sharp/Profile/ProfileSingleShow.php Updated to use new command class and modernized array syntax
demo/app/Sharp/Profile/Commands/UpdateProfilePasswordCommand.php Removed legacy custom implementation
demo/app/Sharp/Profile/Commands/ChangePasswordCommand.php New demo implementation using the trait

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants