Skip to content

Commit 6887814

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Misspelled word Display a better error design when the toolbar cannot be displayed do not validate empty values [Console] fix description of INF default values [PropertyAccess] Fix TypeError discard [Validator] Throw exception on Comparison constraints null options Identify tty tests in Component/Process [Security] Fix annotation
2 parents 3f50940 + 46ee197 commit 6887814

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Authentication/Token/UsernamePasswordToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UsernamePasswordToken extends AbstractToken
2727
* Constructor.
2828
*
2929
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
30-
* @param string $credentials This usually is the password of the user
30+
* @param mixed $credentials This usually is the password of the user
3131
* @param string $providerKey The provider key
3232
* @param (RoleInterface|string)[] $roles An array of roles
3333
*

Validator/Constraints/UserPasswordValidator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public function validate($password, Constraint $constraint)
3939
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword');
4040
}
4141

42+
if (null === $password || '' === $password) {
43+
return;
44+
}
45+
4246
$user = $this->tokenStorage->getToken()->getUser();
4347

4448
if (!$user instanceof UserInterface) {

0 commit comments

Comments
 (0)