Returns the login path for the url and will append a next param

@param Request $request
@return string
484873
protected function createLoginPath(Request $request)
    {
        $url = $this->loginPath;
        $url .= $this->appendNextUrl($request) ?  '?'. self::NEXT_URL_PARAMETER . '=' . $request->getPathInfo() : '';

        return $url;
    }
819115
public static function getQueryString(Request $request): ?string
    {
        $qs = $request->server->get('QUERY_STRING', '');
        if ('' === $qs) {
            return null;
        }

        $parts = [];

        foreach (explode('&', $qs) as $param) {
            if ('' === $param || '=' === $param[0]) {
                // Ignore useless delimiters, e.g. "x=y&".
                // Also ignore pairs with empty key, even if there was a value, e.g. "=value", as such nameless values cannot be retrieved anyway.
                // PHP also does not include them when building _GET.
                continue;
            }

            $keyValuePair = explode('=', $param, 2);

            // GET parameters, that are submitted from a HTML form, encode spaces as "+" by default (as defined in enctype application/x-www-form-urlencoded).
            // PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str. This is why we use urldecode and then normalize to
            // RFC 3986 with rawurlencode.
            $parts[] = isset($keyValuePair[1]) ?
                rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) :
                rawurlencode(urldecode($keyValuePair[0]));
        }

        return implode('&', $parts);
    }
203553
private function getUri(Request $request): string
    {
        if ($request->attributes->has('ngbmContextUri')) {
            return $request->attributes->get('ngbmContextUri');
        }

        return $request->getRequestUri();
    }
1069460
public function loginAction(Request $request)
    {
        if ($this->isGranted(AuthenticatedVoter::IS_AUTHENTICATED_REMEMBERED)) {
            return $this->redirectToRoute($this->getParameter('darvin_user.already_logged_in_redirect_route'));
        }

        return new Response($this->getSecurityFormRenderer()->renderLoginForm($request->isXmlHttpRequest()));
    }
697086
protected function getThrottleKey(Request $request)
    {
        return mb_strtolower($request->input($this->loginUsername())) .'|' .$request->ip();
    }
1114442
private function getNormalizedPath(Request $request)
    {
        $path  = ltrim($request->getPathInfo(), '/');
        $paths = explode(self::PATH_PARAMS_SEPARATOR, $path);
        
        return current($paths);
    }
1105492
public function loginAction(Request $request): Response
    {
        $authenticationUtils = $this->get('security.authentication_utils');
        $error = $authenticationUtils->getLastAuthenticationError();
        $lastUsername = $authenticationUtils->getLastUsername();

        $options = $request->attributes->get('_sylius');

        $template = $options['template'] ?? null;
        Assert::notNull($template, 'Template is not configured.');

        $formType = $options['form'] ?? UserLoginType::class;
        $form = $this->get('form.factory')->createNamed('', $formType);

        return $this->render($template, [
            'form' => $form->createView(),
            'last_username' => $lastUsername,
            'error' => $error,
        ]);
    }
126787
private function getCanonicalUrl(Request $request)
    {
        $uri = $request->getUri();
        $return = 'https://alltubedownload.net/';

        $path = $uri->getPath();
        if ($path != '/') {
            $return .= $path;
        }

        $query = $uri->getQuery();
        if (!empty($query)) {
            $return .= '?'.$query;
        }

        return $return;
    }
768804
protected function getCurrentUri(Request $request, array $parameters = [])
    {
        $params = $request->attributes->get('_route_params');

        return $this->generateUrl($request->attributes->get('_route'), array_merge($params, $parameters));
    }
962880
protected function findRoute(Request $request)
    {
        if (! in_array($request->method(), array('GET', 'HEAD', 'OPTIONS'))) {
            return;
        }

        $uri = $request->path();

        foreach ($this->routes as $pattern => $callback) {
            if (preg_match('#^' .$pattern .'$#s', $uri, $matches)) {
                return array($callback, array_slice($matches, 1));
            }
        }
    }
698825
protected function attemptLogin(Request $request)
    {
        return $this->guard()->attempt(
            $this->credentials($request), $request->filled('remember')
        );
    }
522681
public function getRoute(Request $request)
    {
        /*
         * This method allows CPanel to hook into our API calls that require Cpanel specific functionality.
         * Be VERY careful editing it, make sure you're code only fires for the specific API call you need to interact with.
         */

        //Load up our routes and replace their placeholders (i.e. :id changes to [0-9a-z]{32})
        foreach ($this->routes as $routeKey => $route_details_array) {
            //Replace placeholders in route
            $regex = str_replace(
                array_keys(static::$API_ROUTING_PLACEHOLDERS),
                array_values(static::$API_ROUTING_PLACEHOLDERS),
                $routeKey
            );

            //Check to see if this is our route
            if (preg_match('#^'.$regex.'/?$#', $request->getUrl())) {
                if (in_array($request->getMethod(), $route_details_array['methods']) || array_key_exists(
                    $request->getMethod(),
                    $route_details_array['methods']
                )
                ) {
                    $this->logger->debug('Route matched for '.$request->getMethod().$request->getUrl().' now using '.$route_details_array['methods'][$request->getMethod()]['function']);

                    return array(
                        'class' => $route_details_array['class'],
                        'function' => $route_details_array['methods'][$request->getMethod()]['function'],
                    );
                }
            }
        }

        //if no route was found call our API normally
        return false;
    }
826794
protected function getCanonicalUrl(Request $request)
    {
        return $this->urlGenerator->generate(
            $request->attributes->get('_route'),
            $request->attributes->get('_route_params'),
            UrlGeneratorInterface::ABSOLUTE_URL
        );
    }
995484
public function postLogin(Request $request)
	{
		$this->validate($request, [
			'email' => 'required|email', 'password' => 'required',
		]);

		$credentials = $request->only('email', 'password');

		if ($this->auth->attempt($credentials, $request->has('remember')))
		{
			return redirect()->intended($this->redirectPath());
		}

		return redirect($this->loginPath())
					->withInput($request->only('email', 'remember'))
					->withErrors([
						'email' => $this->getFailedLoginMessage(),
					]);
	}
11580
public function loginAction(Request $request)
        {

            if ($this->container->getParameter('database_password') === null) {
                return $this->redirect($this->generateUrl('install_license'));
            } else {
                $request = $this->getRequest();
                $session = $request->getSession();

                // get the login error if there is one
                if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
                    $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
                } else {
                    $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
                }


                return $this->render('SlashworksBackendBundle:Security:login.html.twig', array(
                    'last_username' => $session->get(SecurityContext::LAST_USERNAME),
                    'error'         => $error,
                ));
            }
        }
205518
private function getUserIdFromSession(Request $request): string
    {
        return $this->session->get($request, self::USER_KEY);
    }
682271
private function getRequestPath($request)
    {
        if (is_string($request)) {
            return $request;
        }

        if (is_array($request)) {
            return $request['path'];
        }

        return $request->path();
    }