/** * Sets the authenticated customer user. * * @param UserInterface $user A UserInterface, or null if no further user should be stored */ public function setCustomerUser(UserInterface $user) { $user->eraseCredentials(); $this->getSession()->setCustomerUser($user); }