Skip to content

Commit d49fb27

Browse files
committed
chore: implement LegacyPasswordAuthenticatedUserInterface::getString
This is because modern password hashing algos include the salt as part of the hashed password. This fixes deprecation messages such as this one: User Deprecated: Since symfony/security-http 5.3: Returning a string from "getSalt()" without implementing the "Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface" interface is deprecated, the "UserBase\Client\Model\User" class should implement it.
1 parent 2aa7588 commit d49fb27

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Model/User.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
use LinkORB\Contracts\UserbaseRole\RoleInterface;
66
use RuntimeException;
7+
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
78
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
89
use Symfony\Component\Security\Core\User\UserInterface as BaseUserInterface;
910

1011
final class User implements
1112
AccountContainerInterface,
1213
BaseUserInterface,
1314
LegacyAdvancedUserInterface,
15+
LegacyPasswordAuthenticatedUserInterface,
1416
PasswordAuthenticatedUserInterface,
1517
PolicyContainerInterface,
1618
RoleInterface,
@@ -36,6 +38,7 @@ final class User implements
3638
private $name;
3739
private $password = '';
3840
private $roles;
41+
private $salt = '';
3942

4043
private $createdAt;
4144
private $lastSeenAt;
@@ -124,7 +127,7 @@ public function setPassword(string $password)
124127
/**
125128
* {@inheritdoc}
126129
*/
127-
public function getSalt()
130+
public function getSalt(): ?string
128131
{
129132
return $this->salt;
130133
}

0 commit comments

Comments
 (0)