/** * @param AuthenticateUserEvent $event * @throws UserException */ public function checkLogin(AuthenticateUserEvent $event) { $data = $event->getAuthenticationData(); $userVo = $data->userVo; if (!empty($userVo->one_time_secret)) { $this->otp->verifyOneTimePassword($userVo, $data->oneTimeToken); } }
/** * @param Request $request * @return bool * @Route("/one_time_password/mail/", name="authenticate.send_otp_mil", methods="POST") * @Guest */ public function sendCodeViaMail(Request $request) : bool { $userName = $request->request->get('user_name'); $this->oneTimePassword->sendCodeViaMail($userName); return true; }