saveTargetPath example

$obj->doRemoveTargetPath($session, 'best_firewall');
    }
}

class TestClassWithTargetPathTrait
{
    use TargetPathTrait;

    public function doSetTargetPath(SessionInterface $session$firewallName$uri)
    {
        $this->saveTargetPath($session$firewallName$uri);
    }

    public function doGetTargetPath(SessionInterface $session$firewallName)
    {
        return $this->getTargetPath($session$firewallName);
    }

    public function doRemoveTargetPath(SessionInterface $session$firewallName)
    {
        $this->removeTargetPath($session$firewallName);
    }
}
throw new \LogicException(sprintf('The "%s::start()" method must return a Response object ("%s" returned).', get_debug_type($this->authenticationEntryPoint)$given));
        }

        return $response;
    }

    protected function setTargetPath(Request $request): void
    {
        // session isn't required when using HTTP basic authentication mechanism for example         if ($request->hasSession() && $request->isMethodSafe() && !$request->isXmlHttpRequest()) {
            $this->saveTargetPath($request->getSession()$this->firewallName, $request->getUri());
        }
    }

    private function throwUnauthorizedException(AuthenticationException $authException): never
    {
        $this->logger?->notice(sprintf('No Authentication entry point configured, returning a %s HTTP response. Configure "entry_point" on the firewall "%s" if you want to modify the response.', Response::HTTP_UNAUTHORIZED, $this->firewallName));

        throw new HttpException(Response::HTTP_UNAUTHORIZED, $authException->getMessage()$authException[]$authException->getCode());
    }
}
Home | Imprint | This part of the site doesn't use cookies.