src/Middleware/UnauthorizedHandler/RedirectHandler.php
public function handle(Exception $exception, ServerRequestInterface $request, ResponseInterface $response, array $options = [])
    {
        $options += $this->defaultOptions;

        if (!$this->checkException($exception, $options['exceptions'])) {
            throw $exception;
        }

        $url = $this->getUrl($request, $options);

        return $response
                ->withHeader('Location', $url)
                ->withStatus($options['statusCode']);
    }
public function handle(Exception $exception, ServerRequestInterface $request, ResponseInterface $response, array $options = [])
    {
        $options += $this->defaultOptions;

        if (!$this->checkException($exception, $options['exceptions'])) {
            throw $exception;
        }

        $url = $this->getUrl($request, $options);

        return $response
                ->withHeader('Location', $url)
                ->withStatus($options['statusCode']);
    }
public function handle ( Exception $ exception , ServerRequestInterface $ request , ResponseInterface $ response , array $ options = [ ] ) { $ options += $ this -> defaultOptions ; if ( ! $ this -> checkException ( $ exception , $ options [ 'exceptions' ] ) ) { throw $ exception ; } $ url = $ this -> getUrl ( $ request , $ options ) ; return $ response -> withHeader ( 'Location' , $ url ) -> withStatus ( $ options [ 'statusCode' ] ) ; }
Return a response with a location header set if an exception matches.

{@inheritDoc}
Return a response with a location header set if an exception matches .