Handles the request from the provider

@param Request $request
@return Redirect
322843
public function handleAuth(Request $request)
    {
        try {
            $user = Socialite::with('github')->stateless()->user();
        } catch (Exception $e) {
            return redirect('/dash-login');
        }

        $request->session()->put(
            config('pagekit.session_key', 'pagekit_session'), [
            'github_id' => $user->id,
            'github_name' => $user->name,
            'github_email' => $user->email
            ]
        );
            $request->session()->save();
            return $user->user['login'];

    }
1139162
public function logout(Request $request)
    {
        $this->guard()->logout();

        $request->session()->invalidate();

        return redirect(route('admin.login'));
    }
658113
public function redirect(Request $request, RedirectRouteInterface $redirectRoute)
    {
        if (410 === $redirectRoute->getStatusCode()) {
            throw new HttpException(410);
        }

        $queryString = http_build_query($request->query->all());

        $url = [
            $redirectRoute->getTarget(),
            false === strpos($redirectRoute->getTarget(), '?') ? '?' : '&',
            $queryString,
        ];

        $url = trim(implode($url), '&? ');

        return new RedirectResponse($url, $redirectRoute->getStatusCode());
    }
889255
public function authentication(Request $request)
    {
        try {
            $this->authRepositoryInterface->authenticate($request->all());
        } catch (FormValidationException $e) {
            Flash::error($e->getMessage());

            return redirect()
              ->route('auth.login')
              ->withErrors($e->getErrors());
        } catch (AuthenticationException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('auth.login');
        }

        return redirect()->route('dashboard.index');
    }
112433
public function moveUpAction(Request $request)
    {
        $context = $this->loadContext($request);

        $resource = $context->getResource();

        $this->isGranted('EDIT', $resource);

        $this->move($resource, -1);

        return $this->redirectToReferer($this->generateUrl(
            $this->config->getRoute('list'),
            $context->getIdentifiers()
        ));
    }
796344
public function update(Request $request)
    {
        $post = $this->api('post.fetch', $request->route('post'))->get();

        $this->authorize('edit', $post);

        $post = $this->api('post.update', $request->route('post'))->parameters($request->only('content'))->patch();

        Forum::alert('success', 'posts.updated');

        return redirect(Forum::route('thread.show', $post));
    }
285870
public function dispatch(Request $request)
    {
        $this->authorize($request);

        return $this->next->dispatch($request);
    }
574634
public function execute($request)
    {
        $logger = $GLOBALS['logger'];

        try {
            parent::execute($request);
        } catch(AuthenticationException $ex) {
            $logger->error('Unauthorized attempt to access resource, being redirected to home page', array($ex->getMessage()));
            $this->_handleUnauthenticatedAccess();
            $this->_response->send();
        }
    }
353467
public function redirectAction(Request $request, Error404 $error404)
    {
        $redirection = new ErrorRedirection();
        $redirection->setError($error404);

        $form = $this->getError404RedirectionForm($redirection);
        $form->handleRequest($request);

        if ($request->query->get('novalidate', false) === false) {
            if ($form->isValid()) {
                if ($redirection->getLink()->getLinkType() !== Link::TYPE_NONE) {
                    $error404->setRedirection($redirection);
                    $redirection->setError($error404);
                    $redirection->setUrl($error404->getUrl());

                    $em = $this->getDoctrine()->getManager();
                    $em->persist($redirection);
                    $em->flush();

                    $this->congrat($this->get('translator')->trans('victoire.404.redirection.success'));

                    return $this->returnAfterRemoval($error404);
                }

                $form->addError(new FormError($this->get('translator')->trans('victoire.404.form.error.blank')));
            }

            $this->warn($this->get('translator')->trans('victoire.404.form.error.unvalid'));

            return new Response($this->renderView('@VictoireSeo/Error404/_list.html.twig', [
                'form'     => $form->createView(),
                'error'    => $error404,
                'isOpened' => true,
            ]), 200, [
                'X-Inject-Alertify' => true,
            ]);
        }

        // rebuild form to avoid wrong form error
        $form = $this->getError404RedirectionForm($redirection);

        return new JsonResponse([
            'html' => $this->renderView('@VictoireSeo/Error404/_list.html.twig', [
                'form'     => $form->createView(),
                'error'    => $error404,
                'isOpened' => true,
            ]),
        ]);
    }
904271
protected function sendLoginResponse(Request $request)
    {
        admin_toastr(trans('admin.login_successful'));

        $request->session()->regenerate();

        return redirect()->intended($this->redirectPath());
    }
1137860
public function login(Request $request)
  {
    $hidden = $this->hidden;
    $request->rules = $this->rules();
    $provider = $this->provider;

    $user = $request->validate(function($response) use ($request, $hidden, $provider) {
      return Auth::attempt($request->all(), $hidden, $provider);
    });

    if (Auth::provider($provider)->login($user)->status == 'success') {
      Redirect::to($this->redirectPath(), 200);
    }
  }
79180
public function update(Request $request)
    {
        $action = $request->input('action');

        $thread = $this->api("thread.{$action}", $request->route('thread'))->parameters($request->all())->patch();

        Forum::alert('success', 'threads.updated', 1);

        return redirect(Forum::route('thread.show', $thread));
    }
110595
public function handle(Request $request)
	{
		$response = $this->next($request);

		$arguments = $this->app['arguments'];
		$output    = $this->app['output'];

		// Check for interactivity flag and set on output accordingly
		if ($arguments->getOpt('non-interactive'))
		{
			$output->makeNonInteractive();
		}

		// Check for color flag and set on output accordingly
		if ($arguments->getOpt('no-colors'))
		{
			$output->makeUnColored();
		}

		// If task is help, set the output to our output class with extra methods for rendering help doc
		if ($arguments->get('task') == 'help')
		{
			$output = $output->getHelpOutput();
		}

		// If the format opt is present, try to use the appropriate output subclass
		if ($arguments->getOpt('format'))
		{
			$output = $output->getOutputFormatter($arguments->getOpt('format'));
		}

		// Register any user specific events
		if ($hooks = Config::get('hooks'))
		{
			foreach ($hooks as $trigger => $scripts)
			{
				foreach ($scripts as $script)
				{
					Event::register($trigger, function() use ($script, $output)
					{
						if ($output->getMode() != 'minimal')
						{
							$output->addLine("Running '{$script}'");
						}
						shell_exec(escapeshellcmd($script));
					});
				}
			}
		}

		// Reset the output stored on the application
		$this->app->forget('output');
		$this->app->set('output', $output);

		return $response;
	}
709929
public function store(Request $request)
	{
		$this->validate($request, Tag::$rules, Tag::$messages);

        $row = $this->createEntry(Tag::class, $request->only('name'));

        return redirect_to_resource();
	}
442974
public function login(Request $request)
    {
        $this->validate($request, [
            'email'    => 'required|max:255',
            'password' => 'required|max:255',
        ]);

        if (Auth::attempt(['email' => $request->email, 'password' => $request->password], $request->remember ? true : false)) {
            return redirect()->intended(route('laralum::index'));
        }

        return redirect()->route('laralum::login')->with('error', trans('auth.failed'))->withInput();
    }
875365
public function handle(Request $request)
    {
        try {
            $restRequest = new RestRequest($this->config, $request->getMethod(), $request->getUri(), $request->getContent());
            $restResponse = $this->adapter->processRequest($restRequest);
        } catch (\Exception $e) {
            if (true === $this->debugEnabled()) {
                throw $e;
            }
            $restResponse = $this->adapter->handleException($e);
        }
        return new Response($restResponse->getContent(), $restResponse->getStatus(), $restResponse->getHeaders());
    }
578478
public function execute (Request $request)
		{
			$parsed = $this->parseRouteRequest($request);

			$controller = $this->getController($request);

			return $controller->dispatch(
				$parsed['method'],
				$parsed['arguments']
			);
		}