Fixed on empty password_enc condition

Change-Id: Ic47f2a390c3ebc6067298b2e23ac842cc16bbcd7
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
smarcet 2020-10-15 11:19:26 -03:00
parent 3c84e475d5
commit 3577ccc4d1

View File

@ -1191,6 +1191,9 @@ class User extends BaseEntity
*/
public function setPassword(string $password): void
{
if(empty($this->password_enc)){
$this->password_enc = AuthHelper::AlgNative;
}
$this->password_salt = AuthHelper::generateSalt(self::SaltLen, $this->password_enc);
$this->password = AuthHelper::encrypt_password($password, $this->password_salt, $this->password_enc);
}