allow to set api token when creating user via API (#3380)

This commit is contained in:
Kevin Papst
2022-06-25 00:26:39 +02:00
committed by GitHub
parent aa8549b633
commit 9f1f7b989c
3 changed files with 25 additions and 2 deletions

View File

@@ -156,8 +156,9 @@ class User implements UserInterface, EquatableInterface, \Serializable
*/
private $apiToken;
/**
* @var string
* @var string|null
* @internal to be set via form, must not be persisted
*
* @Assert\NotBlank(groups={"ApiTokenUpdate"})
* @Assert\Length(min="8", max="60", groups={"ApiTokenUpdate"})
*/
@@ -848,6 +849,7 @@ class User implements UserInterface, EquatableInterface, \Serializable
public function eraseCredentials()
{
$this->plainPassword = null;
$this->plainApiToken = null;
}
/**