-
Notifications
You must be signed in to change notification settings - Fork 80
Password change #655
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
base: main
Are you sure you want to change the base?
Password change #655
Conversation
There was a problem hiding this 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
IsChangePasswordCommandTraitwith 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>
Adds an helper (trait) to simplify the creation of a password change command