/** * Validates the code, which was entered by the user * * @param TwoFactorInterface2 $user * @param string $code * @return bool */ public function checkCode(TwoFactorInterface $user, $code) { $result = $this->authenicator->AuthenticateREST($user->getUsername(), $code); $this->result = $this->authenicator->result; return $result; }
/** * Resets an authentication code an persist it * * @param \Scheb\TwoFactorBundle\Model\InWebo\TwoFactorInterface $user */ public function resetAndPersist(TwoFactorInterface $user) { $user->setInWeboAuthenticatorSecret(null); $this->persister->persist($user); }