Neos\Flow\Security\Context::getInterceptedRequest PHP Method

getInterceptedRequest() public method

Returns the request, that has been stored for later resuming after it has been intercepted by a security exception, NULL if there is none.
public getInterceptedRequest ( ) : ActionRequest
return Neos\Flow\Mvc\ActionRequest
    public function getInterceptedRequest()
    {
        return $this->interceptedRequest;
    }

Usage Example

 /**
  * Calls the authentication manager to authenticate all active tokens
  * and redirects to the original intercepted request on success if there
  * is one stored in the security context. If no intercepted request is
  * found, the function simply returns.
  *
  * If authentication fails, the result of calling the defined
  * $errorMethodName is returned.
  *
  * Note: Usually there is no need to override this action. You should use
  * the according callback methods instead (onAuthenticationSuccess() and
  * onAuthenticationFailure()).
  *
  * @return string
  * @Flow\SkipCsrfProtection
  */
 public function authenticateAction()
 {
     $authenticationException = null;
     try {
         $this->authenticationManager->authenticate();
     } catch (AuthenticationRequiredException $exception) {
         $authenticationException = $exception;
     }
     if ($this->authenticationManager->isAuthenticated()) {
         $storedRequest = $this->securityContext->getInterceptedRequest();
         if ($storedRequest !== null) {
             $this->securityContext->setInterceptedRequest(null);
         }
         return $this->onAuthenticationSuccess($storedRequest);
     } else {
         $this->onAuthenticationFailure($authenticationException);
         return call_user_func([$this, $this->errorMethodName]);
     }
 }