コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 /**
  * 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);
 }