diff --git a/src/Entity/User.php b/src/Entity/User.php index bb712b2..7b8793e 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -18,7 +18,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?string $email; #[ORM\Column(type: 'text')] - private ?string $password; + private ?string $password = null; #[ORM\Column(type: 'integer', nullable: true)] private ?int $personId = null; @@ -32,10 +32,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column(type: 'datetime_immutable', nullable: true)] private ?\DateTimeImmutable $lastLoginAt = null; - public function __construct(string $email, string $password) + public function __construct(string $email) { $this->email = $email; - $this->password = base64_encode($password); } public function getId(): ?int diff --git a/src/Security/BpnAuthenticator.php b/src/Security/BpnAuthenticator.php index 5c0e4b3..13470e1 100644 --- a/src/Security/BpnAuthenticator.php +++ b/src/Security/BpnAuthenticator.php @@ -87,11 +87,12 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent $userRepository = $this->entityManager->getRepository(User::class); if (null === $user = $userRepository->findOneBy(['email' => $email])) { - $user = new User($email, $encryptedPassword); + $user = new User($email); $this->entityManager->persist($user); } $user + ->setPassword($encryptedPassword) ->setPersonId($personId) ->setAddressId($addressId) ->setRoles($roles)