$criteria->
addAssociation('salutation'
);
$criteria->
setLimit(1
);
$customer =
$this->customerRepository
->
search($criteria,
$new->
getContext()) ->
first();
\
assert($customer instanceof CustomerEntity
);
$response =
new CustomerResponse($customer);
$event =
new CustomerLoginEvent($new,
$customer,
$newToken);
$this->eventDispatcher->
dispatch($event);
$response->headers->
set(PlatformRequest::HEADER_CONTEXT_TOKEN,
$newToken);
return $response;
} private function getBeforeConfirmValidation(string
$emHash): DataValidationDefinition
{ $definition =
new DataValidationDefinition('registration.opt_in_before'
);
$definition->
add('em',
new EqualTo(['value' =>
$emHash]));