useTrustedOption() public method

{@inheritDoc}
public useTrustedOption ( )
 /**
  * Ask for Google authentication code.
  *
  * @param AuthenticationContext $context
  *
  * @return Response|null
  */
 public function requestAuthenticationCode(AuthenticationContext $context)
 {
     $user = $context->getUser();
     $request = $context->getRequest();
     $session = $context->getSession();
     // Display and process form
     $authCode = $request->get($this->authCodeParameter);
     if ($authCode !== null) {
         if ($this->authenticator->checkCode($user, $authCode)) {
             $context->setAuthenticated(true);
             return new RedirectResponse($request->getUri());
         } else {
             $session->getFlashBag()->set('two_factor', 'scheb_two_factor.code_invalid');
         }
     }
     // Force authentication code dialog
     return $this->templating->renderResponse($this->formTemplate, array('useTrustedOption' => $context->useTrustedOption()));
 }
 /**
  * requestAuthenticationCode
  * @param AuthenticationContext $context
  * @return \Symfony\Component\HttpFoundation\Response|null
  **/
 public function requestAuthenticationCode(AuthenticationContext $context)
 {
     $user = $context->getUser();
     $request = $context->getRequest();
     $session = $context->getSession();
     $authData = $request->get($this->authCodeParameter);
     if (null !== $authData) {
         if ($this->authenticator->checkRequest($user, json_decode($session->get('u2f_authentication')), json_decode($authData))) {
             $context->setAuthenticated(true);
             return new RedirectResponse($request->getUri());
         } else {
             $session->getFlashBag()->set('two_factor', 'r_u2f_two_factor.code_invalid');
         }
     }
     $authenticationData = json_encode($this->authenticator->generateRequest($user), JSON_UNESCAPED_SLASHES);
     $session->set('u2f_authentication', $authenticationData);
     return $this->templating->renderResponse($this->formTemplate, array('authenticationData' => $authenticationData, 'useTrustedOption' => $context->useTrustedOption()));
 }
 public function requestAuthenticationCode(AuthenticationContext $context)
 {
     $user = $context->getUser();
     $request = $context->getRequest();
     $session = $context->getSession();
     // Display and process form
     $authCode = $request->get($this->authCodeParameter);
     if ($authCode !== null) {
         $result = $this->authenticator->checkCode($user, $authCode);
         if ($result) {
             //get the inwebo alias
             $alias = $result['alias'];
             //Persist the alias to the database to be used in case we do 2FA only once
             $this->codeHandler->getAndPersist($user, $alias);
             $context->setAuthenticated(true);
             return new RedirectResponse($request->getUri());
         } else {
             $session->getFlashBag()->set("two_factor", "scheb_two_factor.code_invalid");
         }
     }
     //die();
     // Force authentication code dialog
     return $this->templating->renderResponse($this->formTemplate, array('useTrustedOption' => $context->useTrustedOption()));
 }
 /**
  * @test
  */
 public function useTrustedOption_trustedOptionDisabled_returnFalse()
 {
     $this->authContext->setUseTrustedOption(false);
     $returnValue = $this->authContext->useTrustedOption();
     $this->assertFalse($returnValue);
 }