private function handlePostReset(Request $request, FormInterface $form)
    {
        $event = new AccessControlEvent($request);
        $username = $form->get('username')->getData();

        // Send a password request mail, if username exists.
        if ($username === null || $username === '') {
            $this->flashes()->error(Trans::__('general.phrase.please-provide-username'));
        } else {
            $this->password()->resetPasswordRequest($username, $request->getClientIp(), $event);
            $response = $this->redirectToRoute('login');
            $response->setVary('Cookies', false)->setMaxAge(0)->setPrivate();

            return $response;
        }

        return null;
    }