Missing case for password rules combination
stuartcusackie opened this issue · comments
- Fortify Version: 1.7.5
- Laravel Version: 8.25.0
Description:
I have set up my password rules like so:
(new Password)
->length(10)
->requireNumeric()
->requireSpecialCharacter(),
It seems there is no case in the message() switch for the above and the error always appears as:
The password must be at least 10 characters.
even if you've met the character count requirements.
Steps:
- Create PasswordValidationRules.php in app/Actions/Fortify.
- Place content:
<?php
namespace App\Actions\Fortify;
use Laravel\Fortify\Rules\Password;
trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array
*/
protected function passwordRules()
{
return [
'required',
'string',
(new Password)
->length(10)
->requireNumeric()
->requireSpecialCharacter(),
'confirmed',
];
}
}
Please provide more specific steps to reproduce this issue.
I've updated my original post above. Thank you.
Yep I see it now. I'll send in a PR.