Description
Problem: After users confirmed there email addresses the user account will be set enabled and users are enabled to login.
An Email (CreateUserNotify) will be send to the user.
Using varibale {user.passwordAutoGenerated} will be always null because in UserUtility::fallbackUsernameAndPassword($user) the password will only be set if password === "". In this step the password will never be empty, because it is already set in the NewController::createAction().
May be there is a better solution in future for this behaviour?
Current workarround: Using BeforeUserConfirmEvent
`
use In2code\Femanager\Event\BeforeUserConfirmEvent;
use In2code\Femanager\Utility\UserUtility;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
class BeforeUserConfirmListener
{
public function __invoke(BeforeUserConfirmEvent $beforeUserConfirmEvent): void
{
$user = $beforeUserConfirmEvent->getUser();
$user->setPassword('');
$user = UserUtility::fallbackUsernameAndPassword($user);
UserUtility::hashPassword($user, $this->settings['new']['misc']['passwordSave']);
}
}
`