Skip to content

Commit 7c06627

Browse files
committed
Remove new password validation from broker
These changes remove all hardcoded valdation from the PasswordBroker. The reason for this is because this is a hardcoded constraint in validation and thus limits people from building password reset forms with their specific flow. The validation is already done within the ResetsPassword trait and is only duplicated in the Broker. The Broker also seems like the wrong place to do this as it only facilitates the retrieval of the user and the token validation (which is still the correct place for these two). This also allows us to remove the https://github.com/laravel/laravel/blob/develop/resources/lang/en/passwords.php#L16 language line. See laravel/framework#25957 (comment)
1 parent 1ddcfb5 commit 7c06627

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

Auth/PasswordBroker.php

-23
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ interface PasswordBroker
2727
*/
2828
const INVALID_USER = 'passwords.user';
2929

30-
/**
31-
* Constant representing an invalid password.
32-
*
33-
* @var string
34-
*/
35-
const INVALID_PASSWORD = 'passwords.password';
36-
3730
/**
3831
* Constant representing an invalid token.
3932
*
@@ -57,20 +50,4 @@ public function sendResetLink(array $credentials);
5750
* @return mixed
5851
*/
5952
public function reset(array $credentials, Closure $callback);
60-
61-
/**
62-
* Set a custom password validator.
63-
*
64-
* @param \Closure $callback
65-
* @return void
66-
*/
67-
public function validator(Closure $callback);
68-
69-
/**
70-
* Determine if the passwords match for the request.
71-
*
72-
* @param array $credentials
73-
* @return bool
74-
*/
75-
public function validateNewPassword(array $credentials);
7653
}

0 commit comments

Comments
 (0)