-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Prep Security (make:user) for 6.0 release #984
Comments
I think this is already done, when I did <?php
namespace App\Security;
use Symfony\Component\Security\Core\User\UserInterface;
class User implements UserInterface
{
private $email;
private $roles = [];
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUserIdentifier(): string
{
return (string) $this->email;
}
/**
* @deprecated since Symfony 5.3, use getUserIdentifier instead
*/
public function getUsername(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
} But I have this error after: Declaration of App\Security\UserProvider::upgradePassword(Symfony\Component\Security\Core\User\UserInterface $user, string $newHashedPassword): void
must be compatible with Symfony\Component\Security\Core\User\PasswordUpgraderInterface::upgradePassword(Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void It's not this? maker-bundle/src/Security/UserClassBuilder.php Lines 43 to 65 in c1ead85
|
Ah, ok, I think you're right. So, there are a few things that we just need to "make sure are correct" on 6.0: A) If we choose "no password", we should NOT get a B) Also based on the above generated code, it looks like it generated a |
Currently, for Symfony 5.x, we still generate (in
make:user
) deprecated methods (because we need to). For example, if I runmake:user
but choose NO to needing a password, it generates:We need to prep MakerBundle before the 6.0 release to be smart enough to not generate these anymore (if you're using 6.0).
The text was updated successfully, but these errors were encountered: