Maybe, I found a solution for role assignment:
1) Add to you FL Registration call: &prepareAfterProcess=`FL-AssignUserRole`
create a snippet "FL-AssignUserRole":
if (isset($data['id'])) {
$userId = $data['id']; // ID of the newly created user
$roleId = 4; // ID of the role to assign
// Assign role using UserManager::setRole
try {
$result = \UserManager::setRole([
'id' => $userId,
'role' => $roleId
]);
} catch (\EvolutionCMS\Exceptions\ServiceValidationException $exception) {
// Handle validation errors
$validateErrors = $exception->getValidationErrors();
$modx->logEvent(0, 3, print_r($validateErrors, true), 'UserManager::setRole Validation Error');
} catch (\EvolutionCMS\Exceptions\ServiceActionException $exception) {
// Handle action errors
$modx->logEvent(0, 3, $exception->getMessage(), 'UserManager::setRole Action Error');
}
}