@param Request $request

@return \Illuminate\Http\RedirectResponse
169800
public function callback(Request $request)
    {
        if ($request->has('error')) {
            switch ($request->get('error')) {
                case 'access_denied':
                    abort(401);
                    break;
                case 'temporarily_unavailable':
                    abort(503);
                    break;
                case 'invalid_request':
                case 'unauthorized_client':
                case 'unsupported_response_type':
                case 'invalid_scope':
                case 'server_error':
                default:
                    abort($request->server->get('REDIRECT_STATUS', 500));
                    break;
            }
        }

        $code = $request->get('code');
        $http = new Client();

        try {
            $response = $http->post(config('openid.server') . '/oauth/token', [
                'form_params' => [
                    'grant_type'    => 'authorization_code',
                    'client_id'     => config('openid.client.id'),
                    'client_secret' => config('openid.client.secret'),
                    'redirect_uri'  => route('openid.callback'),
                    'code'          => $code,
                ],
            ]);

            $this->checkError($response);
            $response = json_decode($response->getBody());

            session([
                'openid_token'  => $response->id_token,
                'access_token'  => $response->access_token,
                'refresh_token' => $response->refresh_token,
                'expires_at'    => Carbon::now()->addSeconds($response->expires_in),
            ]);
        } catch (\Exception $exception) {
            if ($exception instanceof ServerException || $exception instanceof ClientException) {
                $this->checkError($exception->getResponse());
            }

            abort($exception->getCode() !== 0 ? $exception->getCode() : 500);
        }

        return redirect()->intended();
    }
783291
public function verify(Request $request)
    {
        if ($user = User::find($request->route('id'))) {
            $user->markEmailAsVerified();
            event(new Verified($user));
        }

        return redirect($this->redirectPath())->with('verified', true);
    }
666669
public function postAction(Request $request)
    {
        $data = $request->request->all();

        $serializer = $this->get('serializer');
        $redirectRoute = $serializer->deserialize(
            json_encode($data),
            $this->getParameter('sulu.model.redirect_route.class'),
            'json'
        );

        $this->getRedirectRouteManager()->save($redirectRoute);
        $this->get('doctrine.orm.entity_manager')->flush();

        return $this->handleView($this->view($redirectRoute));
    }
360736
public function update(Request $request)
    {
        $this->validate($request, [
            'navbar_color' => 'max:255',
            'favicon'      => 'url|max:2000',
        ]);
        Customization::first()->update([
            // 'color'             => $request->input('color'),
            // 'background_color'  => $request->input('background_color'),
            'navbar_color'      => $request->navbar_color,
            'favicon'           => $request->favicon,
        ]);

        return redirect()->route('laralum::settings.index', ['p' => 'Customization'])->with('success', __('laralum_customization::general.updated_settings'));
    }
376374
public function register(Request $request)
    {
        $this->validator($request->all())->validate();

        event(new Registered($user = $this->create($request->all())));

        $this->guard()->login($user);

        return $this->registered($request, $user)
                        ?: redirect($this->redirectPath());
    }
324728
protected function nextStep(Request $request)
    {
        // Apply the current step. If success, we can redirect to next one
        $currentStep = \SetupWizard::currentStep();
        if (!$currentStep->apply($request->all())) {
            return view()->make('setup_wizard::steps.default', ['errors' => $currentStep->getMessageBag()]);
        }

        // If we have a next step, go for it. Else we redirect to somewhere else
        try {
            $nextStep = \SetupWizard::nextStep();

            return redirect()->route('setup_wizard.show', ['slug' => $nextStep->getSlug()]);
        } catch (StepNotFoundException $e) {
            $finalRouteName = config('setup_wizard.routing.success_route', '');
            if (!empty($finalRouteName)) return redirect()->route($finalRouteName);

            $finalRouteUrl = config('setup_wizard.routing.success_url', '');
            if (!empty($finalRouteUrl)) return redirect()->to($finalRouteUrl);

            return redirect('/');
        }
    }
408457
public function resend(Request $request)
    {
        if ($request->user()->hasVerifiedEmail()) {
            return redirect($this->redirectPath());
        }

        $request->user()->sendEmailVerificationNotification();

        return back()->with('resent', true);
    }
1143917
public function postUserRolePermissions(Request $request)
  {
    $this->validate($request, ['role' => 'required', 'permissions' => 'required']);
    $role = Role::with('permissions')->whereName($request->role)->first();
    $role->permissions()->detach();
    foreach ($request->permissions as $permission_name) {
      $permission = Permission::whereName($permission_name)->first();
      $role->assign($permission);
    }
    \Session::flash('flash_message', 'Permission granted!');
    return \Redirect::route('admin.assign-role-permissions',[
    ]);
  }
973868
public function handle(Request $request, callable $next)
    {
        $response = $next($request);

        if ( !$response instanceof Redirect ) {
            return $response;
        }

        $url = $this->router->routeNameToUrlString(
            $response->getRouteName(),
            $response->getParams()
        );

        return new RedirectResponse(
            $url,
            $response->getRedirectionCode()
        );
    }
968561
public function addAction(Request $request): Response
    {
        $form = $this->formFactory->addTranslation();
        $form->handleRequest($request);

        /** @var TranslationAddData $data */
        $data = $form->getData();
        $location = $data->getLocation();

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (TranslationAddData $data) {
                $location = $data->getLocation();
                $contentInfo = $location->getContentInfo();
                $language = $data->getLanguage();
                $baseLanguage = $data->getBaseLanguage();

                return new RedirectResponse($this->generateUrl('ezplatform.content.translate', [
                    'contentId' => $contentInfo->id,
                    'fromLanguageCode' => null !== $baseLanguage ? $baseLanguage->languageCode : null,
                    'toLanguageCode' => $language->languageCode,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        $redirectionUrl = null !== $location
            ? $this->generateUrl('_ezpublishLocation', ['locationId' => $location->id])
            : $this->generateUrl('ezplatform.dashboard');

        return $this->redirect($redirectionUrl);
    }
628289
public function postLogin(Request $request)
    {
        $credentials = $request->only(['mobile', 'password']);

        $validator = Validator::make($credentials, [
            'mobile' => 'required', 'password' => 'required',
        ]);

        if ($validator->fails()) {
            return Redirect::back()->withInput()->withErrors($validator);
        }

        if (Auth::guard('merchant')->attempt($credentials)) {
            merchant_toastr(trans('merchant.login_successful'));

            return redirect()->intended(config('merchant.route.prefix'));
        }

        return Redirect::back()->withInput()->withErrors(['mobile' => $this->getFailedLoginMessage()]);
    }
1192515
public function addAction(Request $request): Response
    {
        $form = $this->formFactory->addCustomUrl();
        $form->handleRequest($request);

        /** @var CustomUrlAddData $data */
        $data = $form->getData();
        $location = $data->getLocation();

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (CustomUrlAddData $data) {
                $this->urlAliasService->createUrlAlias(
                    $data->getLocation(),
                    $data->getPath(),
                    $data->getLanguage()->languageCode,
                    $data->isRedirect()
                );

                return $this->redirectToLocation($data->getLocation(), UrlsTab::URI_FRAGMENT);
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        if ($location) {
            return $this->redirectToLocation($location, UrlsTab::URI_FRAGMENT);
        }

        return $this->redirectToRoute('ezplatform.dashboard');
    }
55342
public function store(Request $request)
    {
        $request = $this->processRequest($request);

        if ($request === true) {
            return $this->redirection();
        }

        $this->validate($request, $this->model->rules());

        $this->model = $this->model->create($request->all());

        $saved = $this->afterSaving($request);

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

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

        return redirect(route('admin.login'));
    }
1142185
protected function sendLoginResponse(Request $request)
    {
        $request->session()->regenerate();

        $this->clearLoginAttempts($request);

        return $this->authenticated($request, $this->guard()->user())
                ?: redirect()->intended($this->redirectPath());
    }
399130
public function store(Request $request)
    {
        $data = $this->validate(request(), [
            'old_url' => 'required',
            'new_url' => 'required'
        ]);

        Redirection::create($data);

        session()->flash('success', 'Redirección registrada con éxito!');
        return redirect()->route('redirecciones.index');
    }
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());
    }